[hackers] [wmii] Fix wmiirc so it works when WMII_FONT contains spaces.

From: sqweek <sqweek_AT_gmail.com>
Date: Thu Oct 11 17:31:58 2007

changeset: 2221:824331e72fff
tag: tip
user: sqweek <sqweek_AT_gmail.com>
date: Thu Oct 11 23:40:26 2007 +0800
summary: Fix wmiirc so it works when WMII_FONT contains spaces.

diff -r fbc6916e4bdc -r 824331e72fff NOTES
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/NOTES Thu Oct 11 23:40:26 2007 +0800
@@ -0,0 +1,3 @@
+3.6 Release Notes
+
+wmiirc users: the semantics of WMII_MENU, WMII_9MENU and WMII_TERM have changed. If you're using them in custom scripts you'll need to change them to "eval $WMII_MENU" instead of just "$WMII_MENU".
diff -r fbc6916e4bdc -r 824331e72fff rc/wmiirc.sh
--- a/rc/wmiirc.sh Mon Oct 08 02:03:02 2007 +0800
+++ b/rc/wmiirc.sh Thu Oct 11 23:40:26 2007 +0800
@@ -16,8 +16,8 @@ WMII_FONT='-*-fixed-medium-r-*-*-13-*-*-
 WMII_FONT='-*-fixed-medium-r-*-*-13-*-*-*-*-*-*-*'
 
 set -- $(echo $WMII_NORMCOLORS $WMII_FOCUSCOLORS)
-WMII_MENU="dmenu -b -fn $WMII_FONT -nf $1 -nb $2 -sf $4 -sb $5"
-WMII_9MENU="wmii9menu -font $WMII_FONT -nf $1 -nb $2 -sf $4 -sb $5 -br $6"
+WMII_MENU="dmenu -b -fn '$WMII_FONT' -nf '$1' -nb '$2' -sf '$4' -sb '$5'"
+WMII_9MENU="wmii9menu -font '$WMII_FONT' -nf '$1' -nb '$2' -sf '$4' -sb '$5' -br '$6'"
 WMII_TERM="xterm"
 
 # Column Rules
@@ -89,7 +89,7 @@ eventstuff() {
                 client=$1; button=$2
                 case "$button" in
                 3)
- do=$($WMII_9MENU -initial "${menulast:-SomeRandomName}" Nop Delete)
+ do=$(eval $WMII_9MENU -initial "${menulast:-SomeRandomName}" Nop Delete)
                         case "$do" in
                         Delete)
                                 wmiir xwrite /client/$client/ctl kill
@@ -115,13 +115,13 @@ eventstuff() {
         Key $MODKEY-m
                 wmiir xwrite /tag/sel/ctl colmode sel max
         Key $MODKEY-a
- Action $(actionlist | $WMII_MENU) &
+ Action $(actionlist | eval $WMII_MENU) &
         Key $MODKEY-p
- sh -c "$($WMII_MENU <$progsfile)" &
+ sh -c "$(eval $WMII_MENU <$progsfile)" &
         Key $MODKEY-t
                 wmiir xwrite /ctl "view $(tagsmenu)" &
         Key $MODKEY-Return
- $WMII_TERM &
+ eval $WMII_TERM &
         Key $MODKEY-Shift-space
                 wmiir xwrite /tag/sel/ctl send sel toggle
         Key $MODKEY-Shift-c
@@ -212,7 +212,7 @@ done
 
 # More functions
 tagsmenu() {
- wmiir ls /tag | sed 's|/||; /^sel$/d' | $WMII_MENU
+ wmiir ls /tag | sed 's|/||; /^sel$/d' | eval $WMII_MENU
 }
 
 actionlist() {
Received on Thu Oct 11 2007 - 17:31:58 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:58:31 UTC