wmiirc-rumai

git clone git://oldgit.suckless.org/wmiirc-rumai/
Log | Files | Refs | README | LICENSE

commit 11d7874e271c57674b91288c3ea05754f8f3416d
parent 2a647da7b1bbb80fa9a176a2b56b21cefcbb259f
Author: Suraj N. Kurapati <sunaku@gmail.com>
Date:   Wed, 13 Sep 2006 20:52:14 -0700

[project @ f953ec6d1fb6dd43fbb6e95cff600a04e3e9020c]

[project @ 88]
* Changed Wmii::View#each to Wmii::View#each_column because floating area isn't a column (it doesn't have /mode file).

* Added shortcuts for setting layouts of all columns in current view.

* Added shortcuts for selection of current column.

Diffstat:
HISTORY | 6++++++
wm.rb | 15++++++++-------
wmiirc-config.rb | 45++++++++++++++++++++++++++++++++++++++-------
3 files changed, 52 insertions(+), 14 deletions(-)

diff --git a/HISTORY b/HISTORY @@ -9,6 +9,12 @@ This is a history of major changes to {my wmii configuration}[http://people.ucsc * Reverted to *wmiir* for event loop, because Ixp#read isn't internally buffered! +* Changed Wmii::View#each to Wmii::View#each_column because floating area isn't a column (it doesn't have /mode file). + +* Added shortcuts for setting layouts of all columns in current view. + +* Added shortcuts for selection of current column. + = 2006-09-12 diff --git a/wm.rb b/wm.rb @@ -398,12 +398,13 @@ module Wmii alias areas children - # Iterates over areas in this view such that destructive operations are supported. If specified, the iteration starts with the area which has the given index. - def each aStartIdx = 0 # :yields: area + # Iterates over columns in this view such that destructive operations are supported. If specified, the iteration starts with the column which has the given index. + # Note that the floating area is not considered to be a column. + def each_column aStartIdx = 1 # :yields: area return unless block_given? - if (i = aStartIdx.to_i) < 0 - i = 0 + if (i = aStartIdx.to_i) < 1 + i = 1 end until i >= (areaList = self.areas).length @@ -457,7 +458,7 @@ module Wmii end else - each 1 do |a| # skip the floating area + each_column do |a| a.mode = :default a.length = aMaxClientsPerColumn end @@ -474,7 +475,7 @@ module Wmii height = area = 0 lastCol = nil - each 1 do |col| # skip floating area + each_column do |col| if area < subtriArea height += 1 @@ -494,7 +495,7 @@ module Wmii end # build second sub-triangle downwards - each(lastCol.index + 1) do |col| + each_column(lastCol.index + 1) do |col| if area > 0 col.length = height area -= height diff --git a/wmiirc-config.rb b/wmiirc-config.rb @@ -47,7 +47,7 @@ FS.def.font = ENV['WMII_FONT'] = '-misc-fixed-medium-r-normal--18-120-100-100-c- FS.def.selcolors = ENV['WMII_SELCOLORS'] = '#ffffff #285577 #4c7899' FS.def.normcolors = ENV['WMII_NORMCOLORS'] = '#222222 #eeeeee #666666' -FS.def.colmode = 'default' +FS.def.colmode = :default FS.def.colwidth = 0 system %{xsetroot -solid '#333333'} @@ -135,17 +135,38 @@ SHORTCUTS = { # apply equal spacing layout to currently focused column "#{LAYOUT_SEQ}w" => lambda do - Wmii.current_area.mode = 'default' + Wmii.current_area.mode = :default + end, + + # apply equal spacing layout to all columns in current view + "#{LAYOUT_SEQ}Shift-w" => lambda do + Wmii.current_view.each_column do |a| + a.mode = :default + end end, # apply stacked layout to currently focused column "#{LAYOUT_SEQ}v" => lambda do - Wmii.current_area.mode = 'stack' + Wmii.current_area.mode = :stack + end, + + # apply stacked layout to all columns in current view + "#{LAYOUT_SEQ}Shift-v" => lambda do + Wmii.current_view.each_column do |a| + a.mode = :stack + end end, # apply maximized layout to currently focused column "#{LAYOUT_SEQ}m" => lambda do - Wmii.current_area.mode = 'max' + Wmii.current_area.mode = :max + end, + + # apply maximized layout to all columns in current view + "#{LAYOUT_SEQ}Shift-m" => lambda do + Wmii.current_view.each_column do |a| + a.mode = :max + end end, # maximize the floating area's focused client @@ -169,22 +190,32 @@ SHORTCUTS = { end, - # add/remove the currently focused client from the selection + # include/exclude the currently focused client from the selection "#{GROUP_SEQ}g" => lambda do Wmii.current_client.invert_selection! end, - # add all clients in the currently focused view to the selection + # include all clients in the currently focused view in the selection "#{GROUP_SEQ}a" => lambda do Wmii.current_view.select! end, + # include all clients in the currently focused column in the selection + "#{GROUP_SEQ}c" => lambda do + Wmii.current_area.select! + end, + + # exclude all clients in the currently focused column from the selection + "#{GROUP_SEQ}Shift-c" => lambda do + Wmii.current_area.unselect! + end, + # invert the selection in the currently focused view "#{GROUP_SEQ}i" => lambda do Wmii.current_view.invert_selection! end, - # nullify the selection + # exclude all clients everywhere from the selection "#{GROUP_SEQ}n" => lambda do Wmii.select_none! end,