Class: Fusuma::Plugin::Appmatcher::Gnome
- Inherits:
-
Object
- Object
- Fusuma::Plugin::Appmatcher::Gnome
- Includes:
- UserSwitcher
- Defined in:
- lib/fusuma/plugin/appmatcher/gnome.rb
Overview
Search Active Window’s Name
Defined Under Namespace
Classes: Matcher
Instance Attribute Summary collapse
-
#reader ⇒ Object
readonly
Returns the value of attribute reader.
-
#writer ⇒ Object
readonly
Returns the value of attribute writer.
Instance Method Summary collapse
-
#initialize ⇒ Gnome
constructor
A new instance of Gnome.
-
#watch_start ⇒ Integer
fork process and watch signal.
Methods included from UserSwitcher
#as_user, #drop_priv, login_user
Constructor Details
#initialize ⇒ Gnome
Returns a new instance of Gnome.
16 17 18 |
# File 'lib/fusuma/plugin/appmatcher/gnome.rb', line 16 def initialize @reader, @writer = IO.pipe end |
Instance Attribute Details
#reader ⇒ Object (readonly)
Returns the value of attribute reader.
14 15 16 |
# File 'lib/fusuma/plugin/appmatcher/gnome.rb', line 14 def reader @reader end |
#writer ⇒ Object (readonly)
Returns the value of attribute writer.
14 15 16 |
# File 'lib/fusuma/plugin/appmatcher/gnome.rb', line 14 def writer @writer end |
Instance Method Details
#watch_start ⇒ Integer
fork process and watch signal
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/fusuma/plugin/appmatcher/gnome.rb', line 22 def watch_start @watch_start ||= begin pid = as_user(proctitle: self.class.name.underscore) do |user| @reader.close ENV["DBUS_SESSION_BUS_ADDRESS"] = "unix:path=/run/user/#{user.uid}/bus" register_on_application_changed(Matcher.new) end pid end end |