wmiirc-rumai

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

commit 2178c15e46ab9b263f5c8d2161359804a358a950
parent b6df778a1cc6e790f2fec89c0daff6ac51c0f1e9
Author: Suraj N. Kurapati <sunaku@gmail.com>
Date:   Sat,  1 Sep 2007 10:11:21 -0700

add 'kill' action which just restart wmii w/o losing all clients

Diffstat:
wmiirc | 4++--
wmiirc-config.rb | 50++++++++++++++++++++++++++++----------------------
2 files changed, 30 insertions(+), 24 deletions(-)

diff --git a/wmiirc b/wmiirc @@ -64,8 +64,8 @@ begin # Utility functions - # Shows a menu with the given items and returns the chosen item. - # If nothing was chosen, then *nil* is returned. + # Shows a menu with the given items and returns the chosen + # item. If nothing was chosen, then *nil* is returned. def show_menu aChoices, aPrompt = nil cmd = "dmenu -b -fn #{WMII_FONT.inspect} " << %w[-nf -nb -sf -sb].zip( diff --git a/wmiirc-config.rb b/wmiirc-config.rb @@ -8,21 +8,21 @@ ################################################################################ module Key - MOD = 'Mod1' - UP = 't' - DOWN = 'n' - LEFT = 'h' - RIGHT = 's' - - PREFIX = MOD + '-Control-' - FOCUS = PREFIX - SEND = PREFIX + 'm,' - SWAP = PREFIX + 'w,' - ARRANGE = PREFIX + 'z,' - GROUP = PREFIX + 'g,' - VIEW = PREFIX + 'v,' - MENU = PREFIX - EXECUTE = PREFIX + MOD = 'Mod1' + UP = 't' + DOWN = 'n' + LEFT = 'h' + RIGHT = 's' + + PREFIX = MOD + '-Control-' + FOCUS = PREFIX + SEND = PREFIX + 'm,' + SWAP = PREFIX + 'w,' + ARRANGE = PREFIX + 'z,' + GROUP = PREFIX + 'g,' + VIEW = PREFIX + 'v,' + MENU = PREFIX + EXECUTE = PREFIX end module Mouse @@ -43,7 +43,7 @@ module Color end end -WMII_FONT = '*-fixed-medium-r-normal-*-18-*-*-*-*-*-*-*' +WMII_FONT = '-*-bitstream vera sans mono-medium-r-*-*-16-*-*-*-*-*-*-*' ################################################################################ @@ -61,7 +61,7 @@ EOF # Column Rules fs.colrules = <<EOF -/./ -> 60+40 +/./ -> 50+50 EOF # Tagging Rules @@ -142,9 +142,13 @@ EOF @actionMenu = find_programs File.dirname(__FILE__) end + action :kill do + fs.ctl = 'quit' + end + action :quit do action :clear - fs.ctl = 'quit' + action :kill end action :clear do @@ -157,11 +161,13 @@ EOF fs.event.open do |f| clients.each do |c| - c.focus - c.ctl = :kill + if c.exist? + c.focus + c.ctl = :kill - # wait until the client is dead - until f.read =~ /DestroyClient #{c.id}/ + # wait until the client is dead + until f.read =~ /DestroyClient #{c.id}/ + end end end end