Class: Fusuma::Plugin::Executors::WmctrlExecutor
- Inherits:
-
Executor
- Object
- Executor
- Fusuma::Plugin::Executors::WmctrlExecutor
- Defined in:
- lib/fusuma/plugin/executors/wmctrl_executor.rb
Overview
Control Window or Workspaces by executing wctrl
Defined Under Namespace
Instance Method Summary collapse
- #config_param_types ⇒ Object
-
#executable?(event) ⇒ TrueClass, FalseClass
check executable.
-
#execute(event) ⇒ nil
execute wmctrl command.
-
#execute_keys ⇒ Array<Symbol>
executor properties on config.yml.
-
#initialize ⇒ WmctrlExecutor
constructor
A new instance of WmctrlExecutor.
- #search_command(event) ⇒ String, NilClass
Constructor Details
#initialize ⇒ WmctrlExecutor
Returns a new instance of WmctrlExecutor.
23 24 25 26 |
# File 'lib/fusuma/plugin/executors/wmctrl_executor.rb', line 23 def initialize super() Workspace.configure(wrap_navigation: config_params(:'wrap-navigation')) end |
Instance Method Details
#config_param_types ⇒ Object
17 18 19 20 21 |
# File 'lib/fusuma/plugin/executors/wmctrl_executor.rb', line 17 def config_param_types { 'wrap-navigation': [TrueClass, FalseClass] } end |
#executable?(event) ⇒ TrueClass, FalseClass
check executable
42 43 44 45 46 |
# File 'lib/fusuma/plugin/executors/wmctrl_executor.rb', line 42 def executable?(event) event.tag.end_with?('_detector') && event.record.type == :index && search_command(event) end |
#execute(event) ⇒ nil
execute wmctrl command
31 32 33 34 35 36 37 |
# File 'lib/fusuma/plugin/executors/wmctrl_executor.rb', line 31 def execute(event) return if search_command(event).nil? MultiLogger.info(wmctrl: search_command(event)) pid = POSIX::Spawn.spawn(search_command(event)) Process.detach(pid) end |
#execute_keys ⇒ Array<Symbol>
executor properties on config.yml
13 14 15 |
# File 'lib/fusuma/plugin/executors/wmctrl_executor.rb', line 13 def execute_keys %i[wmctrl workspace] end |
#search_command(event) ⇒ String, NilClass
51 52 53 |
# File 'lib/fusuma/plugin/executors/wmctrl_executor.rb', line 51 def search_command(event) search_workspace_command(event) || search_window_command(event) end |