4 # Configuration Variables
11 # Colors tuples: "<text> <background> <border>"
12 WMII_NORMCOLORS='#222222 #5FBF77 #2A7F3F'
13 WMII_FOCUSCOLORS='#ffffff #153F1F #2A7F3F'
15 WMII_BACKGROUND='#333333'
16 WMII_FONT='-*-fixed-medium-r-*-*-15-*-*-*-*-*-*-*'
18 set -- $(echo $WMII_NORMCOLORS $WMII_FOCUSCOLORS)
19 WMII_MENU="dmenu -b -fn $WMII_FONT -nf $1 -nb $2 -sf $4 -sb $5"
20 WMII_9MENU="wmii9menu -font $WMII_FONT -nf $1 -nb $2 -sf $4 -sb $5 -br $6"
21 WMII_TERM="x-terminal-emulator"
24 wmiir write /colrules <<!
29 wmiir write /tagrules <<!
37 echo -n $(uptime | sed 's/.*://; s/,//g') '|' $(date)
41 # Processed later by `wmiiloop' and evaled.
42 # Duplicate the eval line and replace 'eval' with 'echo' for details.
52 fn=$(echo "$@" | sed 's/[^a-zA-Z_0-9]/_/g')
55 echo "$WMII_NORMCOLORS" "$@" | wmiir create "/lbar/$@"
57 wmiir remove "/lbar/$@"
59 wmiir xwrite "/lbar/$@" "$WMII_FOCUSCOLORS" "$@"
61 wmiir xwrite "/lbar/$@" "$WMII_NORMCOLORS" "$@"
64 wmiir xwrite "/lbar/$@" "*$@"
67 wmiir xwrite "/lbar/$@" "$@"
70 wmiir xwrite /ctl view "$@"
73 wmiir xwrite /ctl quit
75 proglist $PATH >$progsfile
78 if wmiir remove /rbar/status 2>/dev/null; then
81 echo "$WMII_NORMCOLORS" | wmiir create /rbar/status
82 while status | wmiir write /rbar/status; do
89 do=$($WMII_9MENU -initial "${menulast:-SomeRandomName}" Nop Delete)
92 wmiir xwrite /client/$client/ctl kill
94 menulast=${do:-"$menulast"}
98 case $(wmiir read /keys | wc -l | tr -d ' \t\n') in
100 echo -n \$Keys | tr ' ' '\012' | wmiir write /keys
101 wmiir xwrite /ctl grabmod $MODKEY;;
103 wmiir xwrite /keys $MODKEY-Control-t
104 wmiir xwrite /ctl grabmod Mod3;;
107 wmiir xwrite /tag/sel/ctl select toggle
109 wmiir xwrite /tag/sel/ctl colmode sel default
111 wmiir xwrite /tag/sel/ctl colmode sel stack
113 wmiir xwrite /tag/sel/ctl colmode sel max
115 Action $(actionlist | $WMII_MENU) &
117 sh -c "$($WMII_MENU <$progsfile)" &
119 wmiir xwrite /ctl "view $(tagsmenu)" &
122 Key $MODKEY-Shift-space
123 wmiir xwrite /tag/sel/ctl send sel toggle
125 wmiir xwrite /client/sel/ctl kill
127 wmiir xwrite "/client/$(wmiir read /client/sel/ctl)/tags" "$(tagsmenu)" &
129 wmiir xwrite /tag/sel/ctl select left
131 wmiir xwrite /tag/sel/ctl select right
133 wmiir xwrite /tag/sel/ctl select down
135 wmiir xwrite /tag/sel/ctl select up
136 Key $MODKEY-Shift-$LEFT
137 wmiir xwrite /tag/sel/ctl send sel left
138 Key $MODKEY-Shift-$RIGHT
139 wmiir xwrite /tag/sel/ctl send sel right
140 Key $MODKEY-Shift-$DOWN
141 wmiir xwrite /tag/sel/ctl send sel down
142 Key $MODKEY-Shift-$UP
143 wmiir xwrite /tag/sel/ctl send sel up
145 for i in 0 1 2 3 4 5 6 7 8 9; do
148 wmiir xwrite /ctl view "$i"
150 wmiir xwrite /client/sel/tags "$i"
156 wmiir write /ctl << EOF
158 focuscolors $WMII_FOCUSCOLORS
159 normcolors $WMII_NORMCOLORS
164 # Feed events to `wmiiloop' for processing
165 echo "$(eventstuff | sed 's/^[ ]//' )" >> ~/.eventstuff
166 eval "$(eventstuff | sed 's/^[ ]//' | { . wmiiloop; })"
171 if [ -n "$action" ]; then
172 Action_$action "$@" \
173 || conf_which $action "$@"
178 paths=$(echo "$@" | sed 'y/:/ /')
179 ls -lL $paths 2>/dev/null \
180 | awk '$1 ~ /^[^d].*x/ { print $NF }' \
185 progsfile="$WMII_NS_DIR/.proglist"
187 proglist $PATH >$progsfile &
189 xsetroot -solid "$WMII_BACKGROUND" &
191 export WMII_MENU WMII_9MENU WMII_FONT WMII_TERM
192 export WMII_FOCUSCOLORS WMII_SELCOLORS WMII_NORMCOLORS
197 wmiir remove "/lbar/$bar"
199 seltag="$(wmiir read /tag/sel/ctl 2>/dev/null)"
200 wmiir ls /tag | sed -e 's|/||; /^sel$/d' |
202 if [ "X$tag" = "X$seltag" ]; then
203 echo "$WMII_FOCUSCOLORS" "$tag" | wmiir create "/lbar/$tag"
205 echo "$WMII_NORMCOLORS" "$tag" | wmiir create "/lbar/$tag"
211 wmiir ls /tag | sed 's|/||; /^sel$/d' | $WMII_MENU
215 { proglist $WMII_CONFPATH
216 echo -n $Actions | tr ' ' '\012'
222 prog=$(PATH="$WMII_CONFPATH" $which $1)
224 if [ -n "$prog" ]; then
229 # Stop any running instances of wmiirc
230 echo Start wmiirc | wmiir write /event || exit 1