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
82 83 84 85 |
# File 'lib/fusuma/plugin/executors/wmctrl_executor.rb', line 82 def current_workspace_num text = `wmctrl -d`.split("\n").grep(/\*/).first text.chars.first.to_i end |
.move_command(direction:) ⇒ Object
87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/fusuma/plugin/executors/wmctrl_executor.rb', line 87 def move_command(direction:) workspace_num = case direction when 'next' current_workspace_num + 1 when 'prev' current_workspace_num - 1 else raise "#{direction} is invalid key" end "wmctrl -s #{workspace_num}" end |