wmiirc-rumai

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

commit 3c309f6b9ff166dc7ca8a952129f3a8fe404399e
parent c42e348488e042c5f2121fa9bde5f83c79fdbaa1
Author: Suraj N. Kurapati <sunaku@gmail.com>
Date:   Wed, 20 Sep 2006 10:07:59 -0700

[project @ 540f83684cb52a7333284dfd5ce08ed542f37660]

[project @ 112]
removed weird method_missing hack for foo.bar! subpath
updated event loop for libixp overload fix

Diffstat:
fs.rb | 3---
wmiirc-config.rb | 81+++++++++++++++++++++++++++++++++++++++----------------------------------------
2 files changed, 40 insertions(+), 44 deletions(-)

diff --git a/fs.rb b/fs.rb @@ -160,9 +160,6 @@ module Ixp when /=$/ self[$`] = *aArgs - when /!$/ - self[$`, false] - else self[aMeth] end diff --git a/wmiirc-config.rb b/wmiirc-config.rb @@ -412,14 +412,15 @@ Thread.new do sb = FS.bar.status sb.create! sb.colors = ENV['WMII_NORMCOLORS'] - sb.data!.open do |f| + + loop do loop do diskSpace = `df -h ~`.split[-3..-1].join(' ') 10.times do cpuLoad = File.read('/proc/loadavg').split[0..2].join(' ') - f.write "#{Time.now.to_s} | #{cpuLoad} | #{diskSpace}" + sb.data = "#{Time.now.to_s} | #{cpuLoad} | #{diskSpace}" sleep 1 end end @@ -429,45 +430,43 @@ end ## WM event loop begin - IXP::Client.new.open('/event') do |f| - while event = f.read.chomp - type, arg = event.split(' ', 2) - - case type.to_sym - when :Start - if arg == __FILE__ - LOG.info "another instance is starting" - exit - end - - when :BarClick - clickedView, clickedButton = arg.split - - case clickedButton.to_i - when PRIMARY_CLICK - Wmii.focus_view clickedView - - when MIDDLE_CLICK - Wmii.selected_clients.each do |c| - c.tag! clickedView - end - - when SECONDARY_CLICK - Wmii.selected_clients.each do |c| - c.untag! clickedView - end - end - - when :ClientClick - clickedClient, clickedButton = arg.split - - if clickedButton.to_i != PRIMARY_CLICK - Wmii.get_client(clickedClient).invert_selection! - end - - when :Key - SHORTCUTS[arg].call - end + while event = FS.event.chomp + type, arg = event.split(' ', 2) + + case type.to_sym + when :Start + if arg == __FILE__ + LOG.info "another instance is starting" + exit + end + + when :BarClick + clickedView, clickedButton = arg.split + + case clickedButton.to_i + when PRIMARY_CLICK + Wmii.focus_view clickedView + + when MIDDLE_CLICK + Wmii.selected_clients.each do |c| + c.tag! clickedView + end + + when SECONDARY_CLICK + Wmii.selected_clients.each do |c| + c.untag! clickedView + end + end + + when :ClientClick + clickedClient, clickedButton = arg.split + + if clickedButton.to_i != PRIMARY_CLICK + Wmii.get_client(clickedClient).invert_selection! + end + + when :Key + SHORTCUTS[arg].call end end rescue EOFError