Re: [dev] [wmii] problem with wmiir xwrite /client/$client/ctl kill

From: Thomas Dean <>
Date: Thu, 27 May 2010 11:22:25 +0200

I ran into the same problem today. The wmiirc script as well as all my
status bar scripts die frequently. All of them are run with dash.
Switching /bin/sh from dash to bash (and replacing dash with bash in
wmiirc) fixes the problem. It seems to be related to the latest update
of dash ( in Debian.

One example is the attached script, which shows my mail count, and
shows ~/.fetchmaillog on a right click. Strangely, the script survives
multiple right clicks (the file is shown in multiple windows), but
dies as soon as one of those windows is closed, either via C-c, or via


# show email information in the status bar

# Configuration

# Functions
mailcount() {
        echo -n `ls -l $@ | grep ^- | wc -l`

output() {
        echo -n Mail `mailcount $maildir/new` `mailcount $maildir/.Lists*/new`

# Trigger event such that previous instances can quit
echo Start $barname | wmiir write /event

# Create bar with content
echo "$WMII_BARCOLORS" | wmiir create /rbar/$barname
wmiir xwrite /rbar/"$barname" `output`

# Event loop
{ wmiir read /event & childpid=$!
  while true; do
          echo "$barname" `output` || { kill $childpid; exit; }
          sleep $delay
  done &
} | while read event
        set -f
        set -- $event
        set +f
        type="$1"; shift
        case "$type" in
        # Exit if another instance starts up
                if test "$1" = "$barname"; then
        # Write output to bar. If that fails, exit.
                wmiir xwrite /rbar/$barname "$@" || exit;;
        # React to clicks on our bar
                if test "$2" = "$barname"; then
                        case "$1" in
                                fetchmail &;;
                                x-terminal-emulator -e tail -n 200 -f ~/.fetchmaillog &;;
Received on Thu May 27 2010 - 09:22:25 UTC

This archive was generated by hypermail 2.2.0 : Thu May 27 2010 - 10:00:03 UTC