Class: Fusuma::Plugin::Executors::WmctrlExecutor::Workspace
- Inherits:
-
Object
- Object
- Fusuma::Plugin::Executors::WmctrlExecutor::Workspace
- Defined in:
- lib/fusuma/plugin/executors/wmctrl_executor.rb
Overview
Manage workspace
Class Method Summary collapse
-
.current_workspace_num ⇒ Integer
get workspace number.
- .move_command(direction:) ⇒ Object
Class Method Details
.current_workspace_num ⇒ Integer
get workspace number
70 71 72 73 |
# File 'lib/fusuma/plugin/executors/wmctrl_executor.rb', line 70 def current_workspace_num text = `wmctrl -d`.split("\n").grep(/\*/).first text.chars.first.to_i end |
.move_command(direction:) ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/fusuma/plugin/executors/wmctrl_executor.rb', line 75 def move_command(direction:) workspace_num = case direction when 'next' current_workspace_num + 1 when 'prev' current_workspace_num - 1 else warn "#{direction} is invalid key" exit 1 end "wmctrl -s #{workspace_num}" end |