I have been using wmii for the past few weeks, and overall I have been
quite happy with it. But I have stumbled across a rather annoying bug with
wmiirc. After I have been running wmii for anywhere between a day and
several days, it will stop responding to keyboard inputs. I blame this on
wmiirc as if I kill it and then start a new one from an open shell, then
keyboard input starts working again. This has happened multiple times.
While wmiirc is locked up, I can still select different, visible windows
with my mouse, but that is about all I can do. Clicking on the status bar
at the bottom of the screen to switch the displayed tag does nothing. If I
run 'wmiir read /event', then I can see keyboard events (and others) being
sent, o it appears that wmii itself it working fine. It is as if that
while/case statement in wmiirc that is reading from /events has jammed.
My wmiirc is pretty basic and standard (see attached) so I don't see
anything in there that could be causing the problem. I am observing this
on both my desktop and laptop, both Debian 3.0 (woody) systems. I grabbed
the source to the 3.0-1 package in Debian testing and recompiled it
without issue for my systems.
I have run strace against wmiirc when it has jammed, but all I (ever) get
is 'wait4(-1'. I currently have strace running against the restarted
wmiirc and logging to a file. When wmiirc locks up again, I will send the
history immediately before the lock up to the list.
Anyone seen this happen before? Anyone have any idea what is going
on? Thanks!
---------------------------------------------------------------------------
| "For to me to live is Christ, and to die is gain." |
| --- Philippians 1:21 (KJV) |
---------------------------------------------------------------------------
| Ryan Kirkpatrick | Boulder, Colorado | http://www.rkirkpat.net/ |
---------------------------------------------------------------------------
#!/bin/sh
# configure wmii
# Utility functions.
xwrite() {
file="$1"; shift
echo -n "$@" | wmiir write "$file"
}
proglist() {
ls -lL "$@" 2>/dev/null | awk 'NF>2 && $1 ~ /^[^d].*x/ {print $NF}' |
sort -u
}
del_tag () {
echo $2 |
awk -v val=$1 '{ split($0,a,/\+/); nr=0;
for(i in a)
if (a[i] != val) {
if (nr++ > 0) printf "+"
printf a[i] }}'
}
add_tag () {
if [ -n "$2" ]; then
echo -n "`del_tag $1 $2`+$1"
else
echo -n $1
fi
}
split_tags () {
echo $* | sed 's/[-+]/\
&/g'
}
# Default keys.
MODKEY=Mod1
UP=k
DOWN=j
LEFT=h
RIGHT=l
# Colors and fonts.
WMII_FONT='fixed'
WMII_SELCOLORS='#ffffff #006600 #004400'
WMII_NORMCOLORS='#aaaaaa #002200 #004400'
export WMII_FONT WMII_NORMCOLORS WMII_SELCOLORS
# give wmiiwm a chance to start
while :
do
echo Start wmiirc | wmiir write /event >/dev/null 2>&1 && break
sleep 1
done
# WM CONFIGURATION
xwrite /def/border 2
xwrite /def/font $WMII_FONT
xwrite /def/selcolors $WMII_SELCOLORS
xwrite /def/normcolors $WMII_NORMCOLORS
xwrite /def/colmode default
xwrite /def/colwidth 0
# TAGGING RULES
wmiir write /def/rules <<EOF
/XMMS.*/ -> ~
/Gimp.*/ -> ~
/MPlayer.*/ -> ~
/.*/ -> !
/.*/ -> 1
EOF
# MISC
xsetroot -solid '#000000'
dpms init
status &
PROGS_FILE=/tmp/.wmiimenu.$USER.proglist
proglist `echo "$PATH" | tr : ' '` >$PROGS_FILE &
# SHORTCUTS
xwrite /def/grabmod $MODKEY
wmiir write /def/keys <<EOF
$MODKEY-$LEFT
$MODKEY-$RIGHT
$MODKEY-$DOWN
$MODKEY-$UP
$MODKEY-space
$MODKEY-d
$MODKEY-f
$MODKEY-s
$MODKEY-m
$MODKEY-a
$MODKEY-p
$MODKEY-t
$MODKEY-0
$MODKEY-1
$MODKEY-2
$MODKEY-3
$MODKEY-4
$MODKEY-5
$MODKEY-6
$MODKEY-7
$MODKEY-8
$MODKEY-9
$MODKEY-Return
$MODKEY-Shift-$LEFT
$MODKEY-Shift-$RIGHT
$MODKEY-Shift-$UP
$MODKEY-Shift-$DOWN
$MODKEY-Shift-space
$MODKEY-Shift-c
$MODKEY-Shift-t
$MODKEY-Shift-0
$MODKEY-Shift-1
$MODKEY-Shift-2
$MODKEY-Shift-3
$MODKEY-Shift-4
$MODKEY-Shift-5
$MODKEY-Shift-6
$MODKEY-Shift-7
$MODKEY-Shift-8
$MODKEY-Shift-9
$MODKEY-Control-$LEFT
$MODKEY-Control-$RIGHT
$MODKEY-Control-$DOWN
$MODKEY-Control-$UP
$MODKEY-Control-x
EOF
# EVENT LOOP
wmiir read /event 2>/dev/null |
while read event
do
set -- $event
type="$1"; shift
case "$type" in
Start)
if test wmiirc = "$1"
then
exit
fi;;
BarClick)
xwrite /ctl view ''"$1"'';;
Key)
case "$1" in
$MODKEY-$LEFT)
xwrite /view/ctl select prev;;
$MODKEY-$RIGHT)
xwrite /view/ctl select next;;
$MODKEY-$DOWN)
xwrite /view/sel/ctl select next;;
$MODKEY-$UP)
xwrite /view/sel/ctl select prev;;
$MODKEY-space)
xwrite /view/ctl select toggle;;
$MODKEY-d)
xwrite /view/sel/mode default;;
$MODKEY-s)
xwrite /view/sel/mode stack;;
$MODKEY-m)
xwrite /view/sel/mode max;;
$MODKEY-f)
xwrite /view/0/sel/geom 0 0 east south;;
$MODKEY-a)
PATH=$HOME/.wmii-3:/etc/X11/wmii-3:$PATH `proglist
/etc/X11/wmii-3 $HOME/.wmii-3 | wmiimenu` &;;
$MODKEY-p)
wmiisetsid `wmiimenu <$PROGS_FILE` &;;
$MODKEY-t)
xwrite /ctl view "`wmiir read /tags | wmiimenu`" &;;
$MODKEY-[0-9])
xwrite /ctl view `echo $1 | sed 's/.*-//'`;;
$MODKEY-Return)
xterm -ls -name "Shell" -title "Shell" &;;
$MODKEY-Shift-$LEFT)
xwrite /view/sel/sel/ctl sendto prev;;
$MODKEY-Shift-$RIGHT)
xwrite /view/sel/sel/ctl sendto next;;
$MODKEY-Shift-$DOWN)
xwrite /view/sel/sel/ctl swap down;;
$MODKEY-Shift-$UP)
xwrite /view/sel/sel/ctl swap up;;
$MODKEY-Shift-space)
xwrite /view/sel/sel/ctl sendto toggle;;
$MODKEY-Shift-c)
xwrite /view/sel/sel/ctl kill;;
$MODKEY-Shift-t)
{
oldtags=`wmiir read /view/sel/sel/tags`
newtags=`wmiir read /tags | wmiimenu`
if echo $newtags | egrep -q '^[+-]'; then
for line in `split_tags $newtags`; do
tag=${line#[+-]}
if [ -n "${line%%-*}" ]; then
oldtags=`add_tag $tag $oldtags`
else
oldtags=`del_tag $tag $oldtags`
fi
done
xwrite /view/sel/sel/tags $oldtags
else
xwrite /view/sel/sel/tags $newtags
fi
}&;;
# xwrite /view/sel/sel/tags ''"`wmiir read /tags |
wmiimenu`"'' &;;
$MODKEY-Shift-[0-9])
xwrite /view/sel/sel/tags `echo $1 | sed 's/.*-//'`;;
$MODKEY-Control-$LEFT)
xwrite /view/sel/sel/ctl swap prev;;
$MODKEY-Control-$RIGHT)
xwrite /view/sel/sel/ctl swap next;;
$MODKEY-Control-$DOWN)
xwrite /view/sel/sel/ctl swap down;;
$MODKEY-Control-$UP)
xwrite /view/sel/sel/ctl swap up;;
$MODKEY-Control-x)
dpms lock;;
esac;;
esac
done &
_______________________________________________
[email protected] mailing list
http://wmii.de/cgi-bin/mailman/listinfo/wmii