wmiirc-rumai

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

commit 349e37f8a313bbff51d70b90a1ac165cc7390a8d
parent 0e2f3aef18b6496f38f9765c5ea5874733bdd8d7
Author: Suraj N. Kurapati <sunaku@gmail.com>
Date:   Mon, 11 May 2009 09:38:50 -0700

terminate existing wmiirc instances BEFORE making changes to wmii

Diffstat:
wmiirc | 24+++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/wmiirc b/wmiirc @@ -24,30 +24,32 @@ $stdout = $stderr = LOG begin LOG.info 'birth' - # load user configuration + # load configuration library config_home = File.dirname(__FILE__) config_libs = File.join(config_home, 'config.rb') config_file = File.join(config_home, 'config.yaml') - require config_libs + require config_libs + + # terminate any existing wmiirc + fs.event.write 'Start wmiirc' + + event 'Start' do |arg| + exit if arg == 'wmiirc' + end + + # apply user configuration load_config_file config_file - # add view buttons to left-bar + # setup tag bar (buttons that correspond to views) fs.lbar.clear tags.each {|t| event 'CreateTag', t } event 'FocusTag', curr_tag - # register keyboard shortcuts + # register key bindings fs.keys.write KEYS.keys.join("\n") event('Key') {|*a| key(*a) } - # terminate existing instances of this configuration - fs.event.write 'Start wmiirc' - - event 'Start' do |arg| - exit if arg == 'wmiirc' - end - # the main event loop fs.event.each_line do |line| line.split("\n").each do |call|