Class: Fusuma::Plugin::Appmatcher::Cosmic
- Inherits:
-
Object
- Object
- Fusuma::Plugin::Appmatcher::Cosmic
- Includes:
- UserSwitcher
- Defined in:
- lib/fusuma/plugin/appmatcher/cosmic.rb
Overview
Search Active Window’s Name for COSMIC desktop via cos-cli (third-party). cos-cli must be installed separately:
cargo install --git https://github.com/estin/cos-cli
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.
Class Method Summary collapse
-
.available? ⇒ Boolean
Search PATH in pure Ruby: the external ‘which` command is not installed on minimal systems (e.g. Arch containers).
Instance Method Summary collapse
-
#initialize ⇒ Cosmic
constructor
A new instance of Cosmic.
- #watch_start ⇒ Object
Methods included from UserSwitcher
#as_user, #drop_priv, login_user
Constructor Details
#initialize ⇒ Cosmic
Returns a new instance of Cosmic.
30 31 32 |
# File 'lib/fusuma/plugin/appmatcher/cosmic.rb', line 30 def initialize @reader, @writer = IO.pipe end |
Instance Attribute Details
#reader ⇒ Object (readonly)
Returns the value of attribute reader.
18 19 20 |
# File 'lib/fusuma/plugin/appmatcher/cosmic.rb', line 18 def reader @reader end |
#writer ⇒ Object (readonly)
Returns the value of attribute writer.
18 19 20 |
# File 'lib/fusuma/plugin/appmatcher/cosmic.rb', line 18 def writer @writer end |
Class Method Details
.available? ⇒ Boolean
Search PATH in pure Ruby: the external ‘which` command is not installed on minimal systems (e.g. Arch containers).
23 24 25 26 27 28 |
# File 'lib/fusuma/plugin/appmatcher/cosmic.rb', line 23 def self.available? ENV.fetch("PATH", "").split(File::PATH_SEPARATOR).any? do |dir| path = File.join(dir, "cos-cli") File.executable?(path) && !File.directory?(path) end end |