[hackers] [wmii] More wmiiloop/newrc updates.

From: Kris Maglione <jg_AT_suckless.org>
Date: Fri Feb 23 01:13:04 2007

changeset: 1937:b5869ada86de
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Thu Feb 22 19:07:58 2007 -0500
summary: More wmiiloop/newrc updates.

diff -r 4fcd84cc5c45 -r b5869ada86de rc/newrc
--- a/rc/newrc Thu Feb 22 18:32:23 2007 -0500
+++ b/rc/newrc Thu Feb 22 19:07:58 2007 -0500
@@ -8,25 +8,15 @@ LEFT=h
 LEFT=h
 RIGHT=l
 
-WMII_FONT='-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*'
 # Colors tuples are "<text> <background> <border>"
 WMII_NORMCOLORS='#222222 #5FBF77 #2A7F3F'
 WMII_FOCUSCOLORS='#ffffff #153F1F #2A7F3F'
 WMII_BACKGROUND='#333333'
+WMII_FONT='-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*'
 
+WMII_TERM="xterm"
 WMII_MENU="dmenu -b -fn '$WMII_FONT' -nb '#5FBF77' -nf '#222222' -sb '#153F1F' -sf '#ffffff'"
-WMII_TERM="xterm"
-
 export WMII_MENU WMII_FONT WMII_FOCUSCOLORS WMII_SELCOLORS WMII_NORMCOLORS WMII_TERM
-
-# WM Configuration
-wmiir write /ctl << EOF
-font $WMII_FONT
-focuscolors $WMII_FOCUSCOLORS
-normcolors $WMII_NORMCOLORS
-grabmod $MODKEY
-border 1
-EOF
 
 # Column Rules
 wmiir write /colrules <<EOF
@@ -42,28 +32,9 @@ wmiir write /tagrules <<EOF
 /.*/ -> 1
 EOF
 
-# Stop any running instances of wmiirc
-echo Start wmiirc | wmiir write /event || exit 1
-
-# Setup Tag Bar
-wmiir ls /lbar |
-while read bar
-do
- wmiir remove "/lbar/$bar"
-done
-
-seltag="$(wmiir read /tag/sel/ctl 2>/dev/null)"
-wmiir ls /tag | sed -e 's|/||; /^sel$/d' |
-while read tag
-do
- if [ "X$tag" = "X$seltag" ]; then
- echo "$WMII_FOCUSCOLORS" "$tag" | wmiir create "/lbar/$tag"
- else
- echo "$WMII_NORMCOLORS" "$tag" | wmiir create "/lbar/$tag"
- fi
-done
-
-{ cat <<EOF
+# Event processing
+{
+cat <<EOF
 # Status Bar Info
 status() {
         echo -n \$(uptime | sed 's/.*://; s/,//g') '|' \$(date)
@@ -92,6 +63,7 @@ Event LeftBarClick
 Event LeftBarClick
         shift
         wmiir xwrite /ctl view "\$@"
+# Actions
 Action quit
         wmiir xwrite /ctl quit
 Action rehash
@@ -104,6 +76,7 @@ Action status
         while status | wmiir write /rbar/status; do
                 sleep 1
         done
+# Key Bindings
 Key $MODKEY-$LEFT
         wmiir xwrite /tag/sel/ctl select left
 Key $MODKEY-$RIGHT
@@ -187,8 +160,39 @@ Action() {
 # Misc
 PROGS_FILE="$WMII_NS_DIR/.proglist"
 Action status &
-xsetroot -solid "$WMII_BACKGROUND" &
 proglist $PATH >$PROGS_FILE &
 EOF
 
-} | wmiiloop | sh
+xsetroot -solid "$WMII_BACKGROUND" &
+
+# WM Configuration
+wmiir write /ctl << EOF
+font $WMII_FONT
+focuscolors $WMII_FOCUSCOLORS
+normcolors $WMII_NORMCOLORS
+grabmod $MODKEY
+border 1
+EOF
+
+# Setup Tag Bar
+wmiir ls /lbar |
+while read bar
+do
+ wmiir remove "/lbar/$bar"
+done
+
+seltag="$(wmiir read /tag/sel/ctl 2>/dev/null)"
+wmiir ls /tag | sed -e 's|/||; /^sel$/d' |
+while read tag
+do
+ if [ "X$tag" = "X$seltag" ]; then
+ echo "$WMII_FOCUSCOLORS" "$tag" | wmiir create "/lbar/$tag"
+ else
+ echo "$WMII_NORMCOLORS" "$tag" | wmiir create "/lbar/$tag"
+ fi
+done
+
+# Stop any running instances of wmiirc
+echo Start wmiirc | wmiir write /event || exit 1
+
+} | wmiiloop | tee /dev/fd/2 | sh
diff -r 4fcd84cc5c45 -r b5869ada86de wmiiloop
--- a/wmiiloop Thu Feb 22 18:32:23 2007 -0500
+++ b/wmiiloop Thu Feb 22 19:07:58 2007 -0500
@@ -1,10 +1,7 @@
-#!/usr/bin/awk
-// && !begin, /# Events/ {
+#!/usr/bin/awk -f
+/^#/ && $2 !~ /^Events|Actions|Key$/ || !begin, \
+/^#/ && $2 ~ /^(Events|Actions|Key)$/ {
         begin = 1
- print
- next
-}
-/^#/ && $2 != "Events", 0 {
         print
         next
 }
diff -r 4fcd84cc5c45 -r b5869ada86de wmiiloop.1
--- a/wmiiloop.1 Thu Feb 22 18:32:23 2007 -0500
+++ b/wmiiloop.1 Thu Feb 22 19:07:58 2007 -0500
@@ -20,8 +20,8 @@ syntax to simplify writing a wmii event
 .B eventloop
 sends any text up to the first line containing
 .I #
-.IR Events ,
-and any text after any line begining with
+.IR Events|Actions|Key ,
+and any text after any other line begining with
 .IR # ,
 directly to its standard output. Any other line is processed based
 on its first word, with every indented line after it taken as its
Received on Fri Feb 23 2007 - 01:13:04 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:47 UTC