wmiirc-rumai

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

commit e9cbb030dd1fc7562c629f2e56b5a5423f0f6d80
parent dd46aa16be0593c310b5fc198860d0c22e404395
Author: Suraj N. Kurapati <sunaku@gmail.com>
Date:   Sun, 10 Sep 2006 19:24:02 -0700

[project @ 798154b58ae0487b75aebc14a95cce6a5d09318c]

[project @ 51]
fix Wmii#attach_last_client

Diffstat:
wm.rb | 6+++---
wmiirc | 35++++++++++++++++++-----------------
2 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/wm.rb b/wm.rb @@ -415,7 +415,7 @@ class Wmii < Container View.new("/#{SELECTION_TAG}").unselect! end - # Invokes the given block for each client in the selection. This is suited for operations which modify the areas of a view by re-numbering the areas indices. + # Invokes the given block for each #selected_clients in a way that supports destructive operations, which change the number of areas in a view. Non-destructive operations can work with #selected_clients directly. def with_selection # :yields: client return unless block_given? @@ -446,8 +446,8 @@ class Wmii < Container # Attach the most recently detached client def attach_last_client - if a = View.new("/#{DETACHED_TAG}").areas.first - if c = a.clients.first + if a = View.new("/#{DETACHED_TAG}").areas.last + if c = a.clients.last c.tags = focused_view.name end end diff --git a/wmiirc b/wmiirc @@ -70,20 +70,21 @@ EOS ## KEY CONFIGURATION -MODKEY='Mod1' -UP='t' -DOWN='n' -LEFT='h' -RIGHT='s' - -DEFAULT="#{MODKEY}-Control-" -FOCUS=DEFAULT -SEND="#{FOCUS}m," -SWAP="#{FOCUS}w," -LAYOUT="#{FOCUS}z," -MENU="#{FOCUS}" -PROGRAM="#{FOCUS}" -GROUP="#{FOCUS}g," +MODKEY = 'Mod1' +UP = 't' +DOWN = 'n' +LEFT = 'h' +RIGHT = 's' + +ACTION = "#{MODKEY}-Control-" +FOCUS = ACTION +SEND = "#{ACTION}m," +SWAP = "#{ACTION}w," +LAYOUT = "#{ACTION}z," +GROUP = "#{ACTION}g," +MENU = ACTION +PROGRAM = ACTION + SHORTCUTS = { # focus previous view @@ -255,7 +256,7 @@ SHORTCUTS = { end, # send to temporary view or switch back again - "#{DEFAULT}b" => lambda do + "#{ACTION}b" => lambda do curView = WM.focused_view.name if curView =~ /~\d+$/ @@ -283,12 +284,12 @@ SHORTCUTS = { end, # wmii-2 style detaching - "#{SEND}d" => lambda do + "#{ACTION}d" => lambda do WM.detach_selection end, # wmii-2 style detaching - "#{SEND}Shift-d" => lambda do + "#{ACTION}Shift-d" => lambda do WM.attach_last_client end,