wmiirc-rumai

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

commit 121d238a13e03beb30ef8a81040c5b6072520cc1
parent 38c2acc1ef76c806e8cf1d3af9d9f3982300bd14
Author: Suraj N. Kurapati <sunaku@gmail.com>
Date:   Mon, 11 Sep 2006 03:41:38 -0700

[project @ 5e691924c8bbcbeeb142261f30e11ce46b3ecd39]

[project @ 59]
fix Area#unshift! wasn't putting @ top of area
up  all selection ops now use Wmii#with_selection because it always works
up  all swapping ops don't work with selection

Diffstat:
wm.rb | 3+--
wmiirc | 28++++++++++++----------------
2 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/wm.rb b/wm.rb @@ -353,9 +353,8 @@ class Wmii < IxpNode return if aClients.empty? clients.first.focus! if exist? - setup_for_insertion! aClients.shift - parent.sel.ctl = 'swap up' + clients.first.ctl = 'swap down' dst = self.index aClients.each do |c| diff --git a/wmiirc b/wmiirc @@ -221,7 +221,7 @@ SHORTCUTS = { end, "#{SEND}Delete" => lambda do - WM.selected_clients.each do |c| + WM.with_selection do |c| c.ctl = 'kill' end end, @@ -232,7 +232,7 @@ SHORTCUTS = { choices = WM.tags.map {|t| [t, "+#{t}", "-#{t}"]}.flatten target = show_menu(choices) - WM.selected_clients.each do |c| + WM.with_selection do |c| c.with_tags do case target when /^\+/ @@ -251,7 +251,7 @@ SHORTCUTS = { # remove currently focused view from current selection's tags "#{SEND}Shift-minus" => lambda do - WM.selected_clients.each do |c| + WM.with_selection do |c| c.with_tags do delete WM.focused_view.name end @@ -312,18 +312,14 @@ SHORTCUTS = { WM.focused_client.ctl = 'swap next' end, - # swap each selected client with the one below it + # swap the currently focused client with the one below it "#{SWAP}#{DOWN}" => lambda do - WM.selected_clients.each do |c| - c.ctl = 'swap down' - end + WM.focused_client.ctl = 'swap down' end, - # swap each selected client with the one above it + # swap the currently focused client with the one above it "#{SWAP}#{UP}" => lambda do - WM.selected_clients.each do |c| - c.ctl = 'swap up' - end + WM.focused_client.ctl = 'swap up' end, } @@ -337,7 +333,7 @@ SHORTCUTS = { # send selection to _i_th view SHORTCUTS["#{SEND}#{i}"] = lambda do - WM.selected_clients.each do |c| + WM.with_selection do |c| c.tags = (WM.tags[k] || i) end end @@ -359,7 +355,7 @@ SHORTCUTS = { # add _i_th view to current selection's tags SHORTCUTS["#{SEND}equal,#{i}"] = SHORTCUTS["#{SEND}Shift-equal,#{i}"] = lambda do - WM.selected_clients.each do |c| + WM.with_selection do |c| c.with_tags do push(WM.tags[k] || i) end @@ -368,7 +364,7 @@ SHORTCUTS = { # remove _i_th view from current selection's tags SHORTCUTS["#{SEND}minus,#{i}"] = lambda do - WM.selected_clients.each do |c| + WM.with_selection do |c| c.with_tags do delete(WM.tags[k] || i) end @@ -430,14 +426,14 @@ begin WM.focus_view viewId when MIDDLE - WM.selected_clients.each do |c| + WM.with_selection do |c| c.with_tags do push viewId end end when SECONDARY - WM.selected_clients.each do |c| + WM.with_selection do |c| c.with_tags do delete viewId end