From fb8b46328880a72a5579f1c8307fa726d5700d09 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 22 Feb 2007 17:02:14 -0500 Subject: [PATCH] A bit more tidying of rc/newrc --- rc/newrc | 59 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/rc/newrc b/rc/newrc index 84ad5079..a05920f5 100644 --- a/rc/newrc +++ b/rc/newrc @@ -52,13 +52,8 @@ wmiir write /tagrules < 1 EOF -PROGS_FILE="$WMII_NS_DIR/.dmenu.proglist" - # Stop any running instances of wmiirc -if ! echo Start wmiirc | wmiir write /event -then - exit 1 -fi +echo Start wmiirc | wmiir write /event || exit 1 # Setup Tag Bar wmiir ls /lbar | @@ -79,12 +74,17 @@ do done { cat <$PROGS_FILE +Action status + if wmiir remove /rbar/status 2>/dev/null; then + sleep 2 + fi + echo $WMII_NORMCOLORS | wmiir create /rbar/status + while status | wmiir write /rbar/status; do + sleep 1 + done Key $MODKEY-$LEFT wmiir xwrite /tag/sel/ctl select left Key $MODKEY-$RIGHT @@ -114,7 +122,7 @@ Key $MODKEY-$DOWN wmiir xwrite /tag/sel/ctl select down Key $MODKEY-$UP wmiir xwrite /tag/sel/ctl select up -Key $MODKEY-space) +Key $MODKEY-space wmiir xwrite /tag/sel/ctl select toggle Key $MODKEY-d wmiir xwrite /tag/sel/ctl colmode sel default @@ -123,13 +131,7 @@ Key $MODKEY-s Key $MODKEY-m wmiir xwrite /tag/sel/ctl colmode sel max Key $MODKEY-a - { set -f - set -- \$(actionlist | $WMII_MENU) - action=\$1; shift - set +f - Action-"\$action" \$@ || - \$(conf_which "\$action") \$@ - } & + Action \$(actionlist | $WMII_MENU) & Key $MODKEY-p sh -c "\$($WMII_MENU <$PROGS_FILE)" & Key $MODKEY-t @@ -162,7 +164,6 @@ done cat </dev/null | @@ -188,8 +189,14 @@ tagsmenu() { wmiir ls /tag | sed "s|/||; /^sel\$/d" | $WMII_MENU } +Action() { + action=\$1; shift + Action-\$action \$@ || \$(conf_which "\$action") \$@ +} + # Misc -\$(conf_which status) & +PROGS_FILE="$WMII_NS_DIR/.proglist" +Action status & xsetroot -solid "$WMII_BACKGROUND" & proglist $PATH >$PROGS_FILE & EOF @@ -212,6 +219,11 @@ EOF actions[arg[2]] = body } } + // && !begin, /# Events/ { + begin = 1 + print + next + } /^#/ && $2 != "Events", 0 { print next @@ -225,10 +237,9 @@ EOF body = body"\n"$0 } END { - for(key in keys) { + for(key in keys) print key | writekeys - print key >"/dev/fd/2" - } + close(writekeys) print "ACTIONS=\"\"" for(action in actions) { gsub("\"", "\\\"", action) @@ -253,4 +264,4 @@ EOF print body fflush() } - }' | sh + }' | tee /dev/fd/2 | sh