Class: Fusuma::Plugin::Appmatcher::X11
- Inherits:
-
Object
- Object
- Fusuma::Plugin::Appmatcher::X11
- Defined in:
- lib/fusuma/plugin/appmatcher/x11.rb
Overview
Search Active Window’s Name
Defined Under Namespace
Classes: Matcher
Instance Attribute Summary collapse
-
#matcher ⇒ Object
readonly
Returns the value of attribute matcher.
-
#reader ⇒ Object
readonly
Returns the value of attribute reader.
-
#writer ⇒ Object
readonly
Returns the value of attribute writer.
Instance Method Summary collapse
-
#initialize ⇒ X11
constructor
A new instance of X11.
-
#watch_start ⇒ Integer
fork process and watch signal.
Constructor Details
#initialize ⇒ X11
Returns a new instance of X11.
15 16 17 |
# File 'lib/fusuma/plugin/appmatcher/x11.rb', line 15 def initialize @reader, @writer = IO.pipe end |
Instance Attribute Details
#matcher ⇒ Object (readonly)
Returns the value of attribute matcher.
13 14 15 |
# File 'lib/fusuma/plugin/appmatcher/x11.rb', line 13 def matcher @matcher end |
#reader ⇒ Object (readonly)
Returns the value of attribute reader.
13 14 15 |
# File 'lib/fusuma/plugin/appmatcher/x11.rb', line 13 def reader @reader end |
#writer ⇒ Object (readonly)
Returns the value of attribute writer.
13 14 15 |
# File 'lib/fusuma/plugin/appmatcher/x11.rb', line 13 def writer @writer end |
Instance Method Details
#watch_start ⇒ Integer
fork process and watch signal
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/fusuma/plugin/appmatcher/x11.rb', line 21 def watch_start @watch_start ||= begin pid = UserSwitcher.new.as_user(proctitle: self.class.name.underscore) do |_user| @reader.close register_on_application_changed(Matcher.new) end Process.detach(pid) pid end end |