lib/fusuma/plugin/wmctrl/workspace.rb in fusuma-plugin-wmctrl-1.3.1 vs lib/fusuma/plugin/wmctrl/workspace.rb in fusuma-plugin-wmctrl-1.4.0
- old
+ new
@@ -29,18 +29,20 @@
next_workspace_num
end
next_workspace_num
end
+ # @raise [MissingMatrixOption]
# @return [Array<Integer>]
def matrix_size(total_workspace_num)
must_have_matrix_option!
col_size = @matrix_col_size
row_size = (total_workspace_num / col_size)
[row_size.to_i, col_size.to_i]
end
+ # @raise [MissingMatrixOption]
def must_have_matrix_option!
return if @matrix_col_size
# FIXME: move to executor
warn(<<~ERRRORMESSAGE)
@@ -55,11 +57,12 @@
ERRRORMESSAGE
raise MissingMatrixOption, "You need to set matrix option to config.yml"
end
# @return [Integer]
- # @raise RuntimeError
+ # @raise [RuntimeError]
+ # @raise [MissingMatrixOption]
def next_workspace_num_for_matrix(direction:)
must_have_matrix_option!
current_workspace_num, total_workspace_num = workspace_values
row_size, col_size = matrix_size(total_workspace_num)
x = current_workspace_num % col_size
@@ -129,9 +132,10 @@
raise "#{direction} is invalid key"
end
"wmctrl -r :ACTIVE: -t #{workspace_num} ; wmctrl -s #{workspace_num}"
end
+ # @raise [MissingMatrixOption]
def move_window_command_for_matrix(direction:)
workspace_num = next_workspace_num_for_matrix(direction: direction)
"wmctrl -r :ACTIVE: -t #{workspace_num} ; wmctrl -s #{workspace_num}"
end