Class: Fusuma::Plugin::Executors::WmctrlExecutor::Window

Inherits:
Object
  • Object
show all
Defined in:
lib/fusuma/plugin/executors/wmctrl_executor.rb

Overview

Manage Window

Class Method Summary collapse

Class Method Details

.closeObject



164
165
166
# File 'lib/fusuma/plugin/executors/wmctrl_executor.rb', line 164

def close
  'wmctrl -c :ACTIVE:'
end

.fullscreen(method:) ⇒ Object

Parameters:

  • method (String)

    “toggle” or “add” or “remove”



169
170
171
# File 'lib/fusuma/plugin/executors/wmctrl_executor.rb', line 169

def fullscreen(method:)
  "wmctrl -r :ACTIVE: -b #{method},fullscreen"
end

.maximized(method:) ⇒ Object

Parameters:

  • method (String)

    “toggle” or “add” or “remove”



160
161
162
# File 'lib/fusuma/plugin/executors/wmctrl_executor.rb', line 160

def maximized(method:)
  "wmctrl -r :ACTIVE: -b #{method},maximized_vert,maximized_horz"
end

.move_command(direction:) ⇒ Object



173
174
175
176
177
178
179
180
181
182
183
# File 'lib/fusuma/plugin/executors/wmctrl_executor.rb', line 173

def move_command(direction:)
  workspace_num = case direction
                  when 'next'
                    Workspace.next_workspace_num(step: 1)
                  when 'prev'
                    Workspace.next_workspace_num(step: -1)
                  else
                    raise "#{direction} is invalid key"
                  end
  "wmctrl -r :ACTIVE: -t #{workspace_num} ; wmctrl -s #{workspace_num}"
end