wmiirc-rumai

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

commit 88de08091c3f28ae98d706263a8f116311d4d9cb
parent 9fe024867d7cda55491c833d71ee93380ea5e684
Author: Suraj N. Kurapati <sunaku@gmail.com>
Date:   Sun, 10 Sep 2006 09:20:34 -0700

[project @ 4f1589a2e96b9868a2f976a1d09ec798856d987e]

[project @ 45]
swapping now operates on the selection instead of only the focused client

Diffstat:
Wmii.rb | 2+-
wmiirc | 24++++++++++++++++--------
2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/Wmii.rb b/Wmii.rb @@ -207,7 +207,7 @@ class Wmii < Container View.new("/#{SELECTION_TAG}").unselect! end - # Invokes the given block for each client in the selection. + # 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. def with_selection # :yields: client return unless block_given? diff --git a/wmiirc b/wmiirc @@ -301,24 +301,32 @@ SHORTCUTS = { SHORTCUTS["#{LAYOUT}z"].call end, - # swap the currently focused client with the one to its left + # swap each selected client with the one to its left "#{SWAP}#{LEFT}" => lambda do - WM.focused_client.ctl = 'swap prev' + WM.with_selection do |c| + c.ctl = 'swap prev' + end end, - # swap the currently focused client with the one to its right + # swap each selected client with the one to its right "#{SWAP}#{RIGHT}" => lambda do - WM.focused_client.ctl = 'swap next' + WM.with_selection do |c| + c.ctl = 'swap next' + end end, - # swap the currently focused client with the one below it + # swap each selected client with the one below it "#{SWAP}#{DOWN}" => lambda do - WM.focused_client.ctl = 'swap down' + WM.selected_clients.each do |c| + c.ctl = 'swap down' + end end, - # swap the currently focused client with the one above it + # swap each selected client with the one above it "#{SWAP}#{UP}" => lambda do - WM.focused_client.ctl = 'swap up' + WM.selected_clients.each do |c| + c.ctl = 'swap up' + end end, }