wmiirc-rumai

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

commit 95c902fcca6045e536d272be2619267a0dca64e2
parent ef0aab47a1b19319ee8fde1e880db28ced047649
Author: Suraj N. Kurapati <sunaku@gmail.com>
Date:   Fri, 15 Sep 2006 08:16:24 -0700

[project @ 2ee03d2dcebf7c7214d0a596194536520c5ac5a5]

[project @ 95]
Added Wmii.get_view and Wmii.get_client methods.

Diffstat:
HISTORY | 9+++++++++
rc.rb | 2+-
wm.rb | 19++++++++++++-------
wmiirc-config.rb | 2+-
4 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/HISTORY b/HISTORY @@ -1,5 +1,14 @@ This is a history of major changes to {my wmii configuration}[http://people.ucsc.edu/~skurapat/wmii.html]. += 2006-09-15 + +* Added Wmii.get_view and Wmii.get_client methods. + + += 2006-09-14 + +* Added ability to swap current client with the currently focused client in any other column. + = 2006-09-13 diff --git a/rc.rb b/rc.rb @@ -145,7 +145,7 @@ end # Attach the most recently detached client def attach_last_client - if a = Wmii::View.new("/#{DETACHED_TAG}").areas.last + if a = Wmii.get_view(DETACHED_TAG).areas.last if c = a.clients.last c.tags = Wmii.current_view.name end diff --git a/wm.rb b/wm.rb @@ -50,7 +50,7 @@ module Wmii # Returns the current set of views. def Wmii.views - tags.map {|v| View.new "/#{v}"} + tags.map {|v| get_view v} end # Returns the current set of clients. @@ -59,14 +59,19 @@ module Wmii end # Returns the client which has the given ID. - def Wmii.client aId + def Wmii.get_client aId Client.new("/client/#{aId}") end + # Returns the view which has the given name. + def Wmii.get_view aName + View.new("/#{aName}") + end + # Searches for a client, which has the given ID, in the given places. If no places are specified, then all views are searched. If the client is not found, *nil* is returned. def Wmii.find_client aClientId, aArea = nil, aView = nil aClientId = aClientId.to_i - needle = Wmii.client(aClientId) + needle = Wmii.get_client(aClientId) if needle.exist? areas = [] @@ -78,7 +83,7 @@ module Wmii areas.concat aView.areas else - needle.tags.map {|t| View.new("/#{t}")}.each do |v| + needle.tags.map {|t| get_view t}.each do |v| areas.concat v.areas end end @@ -100,7 +105,7 @@ module Wmii # Focuses the view with the given name. def Wmii.focus_view aName - View.new("/#{aName}").focus! + get_view(aName).focus! end # Focuses the area with the given ID in the current view. @@ -140,7 +145,7 @@ module Wmii # Un-selects all selected clients so that there is nothing selected. def Wmii.select_none! - View.new("/#{SELECTION_TAG}").unselect! + get_view(SELECTION_TAG).unselect! end @@ -438,7 +443,7 @@ module Wmii end secCol.mode = :default - priCol.mode = :max + #priCol.mode = :max priClient.focus! end end diff --git a/wmiirc-config.rb b/wmiirc-config.rb @@ -465,7 +465,7 @@ begin clickedClient, clickedButton = arg.split if clickedButton.to_i != PRIMARY_CLICK - Wmii.client(clickedClient).invert_selection! + Wmii.get_client(clickedClient).invert_selection! end when :Key