4 # Configuration Variables
11 # Colors tuples: "<text> <background> <border>"
12 WMII_NORMCOLORS='#bbbbbb #111111 #333333'
13 WMII_FOCUSCOLORS='#ffffff #285577 #4c7899'
14 #WMII_FOCUSCOLORS='#ffffff #153F1F #2A7F3F'
16 WMII_BACKGROUND='#111111'
17 WMII_FONT='-*-fixed-medium-r-*-*-15-*-*-*-*-*-*-*'
19 set -- $(echo $WMII_NORMCOLORS $WMII_FOCUSCOLORS)
20 WMII_MENU="dmenu -b -fn $WMII_FONT -nf $1 -nb $2 -sf $4 -sb $5"
21 WMII_9MENU="wmii9menu -font $WMII_FONT -nf $1 -nb $2 -sf $4 -sb $5 -br $6"
22 WMII_TERM="x-terminal-emulator"
25 wmiir write /colrules <<!
30 wmiir write /tagrules <<!
38 echo -n $(uptime | sed 's/.*://; s/,//g') '|' $(date)
42 # Processed later by `wmiiloop' and evaled.
43 # Duplicate the eval line and replace 'eval' with 'echo' for details.
53 fn=$(echo "$@" | sed 's/[^a-zA-Z_0-9]/_/g')
56 echo "$WMII_NORMCOLORS" "$@" | wmiir create "/lbar/$@"
58 wmiir remove "/lbar/$@"
60 wmiir xwrite "/lbar/$@" "$WMII_FOCUSCOLORS" "$@"
62 wmiir xwrite "/lbar/$@" "$WMII_NORMCOLORS" "$@"
65 wmiir xwrite "/lbar/$@" "*$@"
68 wmiir xwrite "/lbar/$@" "$@"
71 wmiir xwrite /ctl view "$@"
74 wmiir xwrite /ctl quit
76 proglist $PATH >$progsfile
79 if wmiir remove /rbar/status 2>/dev/null; then
82 echo "$WMII_NORMCOLORS" | wmiir create /rbar/status
83 while status | wmiir write /rbar/status; do
90 do=$($WMII_9MENU -initial "${menulast:-SomeRandomName}" Nop Delete)
93 wmiir xwrite /client/$client/ctl kill
95 menulast=${do:-"$menulast"}
99 case $(wmiir read /keys | wc -l | tr -d ' \t\n') in
101 echo -n \$Keys | tr ' ' '\012' | wmiir write /keys
102 wmiir xwrite /ctl grabmod $MODKEY;;
104 wmiir xwrite /keys $MODKEY-Control-t
105 wmiir xwrite /ctl grabmod Mod3;;
108 wmiir xwrite /tag/sel/ctl select toggle
110 wmiir xwrite /tag/sel/ctl colmode sel default
112 wmiir xwrite /tag/sel/ctl colmode sel stack
114 wmiir xwrite /tag/sel/ctl colmode sel max
116 Action $(actionlist | $WMII_MENU) &
118 sh -c "$($WMII_MENU <$progsfile)" &
120 wmiir xwrite /ctl "view $(tagsmenu)" &
123 Key $MODKEY-Shift-space
124 wmiir xwrite /tag/sel/ctl send sel toggle
126 wmiir xwrite /client/sel/ctl kill
128 wmiir xwrite "/client/$(wmiir read /client/sel/ctl)/tags" "$(tagsmenu)" &
130 wmiir xwrite /tag/sel/ctl select left
132 wmiir xwrite /tag/sel/ctl select right
134 wmiir xwrite /tag/sel/ctl select down
136 wmiir xwrite /tag/sel/ctl select up
137 Key $MODKEY-Shift-$LEFT
138 wmiir xwrite /tag/sel/ctl send sel left
139 Key $MODKEY-Shift-$RIGHT
140 wmiir xwrite /tag/sel/ctl send sel right
141 Key $MODKEY-Shift-$DOWN
142 wmiir xwrite /tag/sel/ctl send sel down
143 Key $MODKEY-Shift-$UP
144 wmiir xwrite /tag/sel/ctl send sel up
146 for i in 0 1 2 3 4 5 6 7 8 9; do
149 wmiir xwrite /ctl view "$i"
151 wmiir xwrite /client/sel/tags "$i"
157 wmiir write /ctl << EOF
159 focuscolors $WMII_FOCUSCOLORS
160 normcolors $WMII_NORMCOLORS
165 # Feed events to `wmiiloop' for processing
166 echo "$(eventstuff | sed 's/^[ ]//' )" >> ~/.eventstuff
167 eval "$(eventstuff | sed 's/^[ ]//' | { . wmiiloop; })"
172 if [ -n "$action" ]; then
173 Action_$action "$@" \
174 || conf_which $action "$@"
179 paths=$(echo "$@" | sed 'y/:/ /')
180 ls -lL $paths 2>/dev/null \
181 | awk '$1 ~ /^[^d].*x/ { print $NF }' \
186 progsfile="$WMII_NS_DIR/.proglist"
188 proglist $PATH >$progsfile &
190 if [ -x /usr/bin/feh ] && [ -r /home/don/media/pictures/shards_of_aleysa.jpg ]; then
191 /usr/bin/feh --bg-scale /home/don/media/pictures/shards_of_aleysa.jpg
195 export WMII_MENU WMII_9MENU WMII_FONT WMII_TERM
196 export WMII_FOCUSCOLORS WMII_SELCOLORS WMII_NORMCOLORS
201 wmiir remove "/lbar/$bar"
203 seltag="$(wmiir read /tag/sel/ctl 2>/dev/null)"
204 wmiir ls /tag | sed -e 's|/||; /^sel$/d' |
206 if [ "X$tag" = "X$seltag" ]; then
207 echo "$WMII_FOCUSCOLORS" "$tag" | wmiir create "/lbar/$tag"
209 echo "$WMII_NORMCOLORS" "$tag" | wmiir create "/lbar/$tag"
215 wmiir ls /tag | sed 's|/||; /^sel$/d' | $WMII_MENU
219 { proglist $WMII_CONFPATH
220 echo -n $Actions | tr ' ' '\012'
226 prog=$(PATH="$WMII_CONFPATH" $which $1)
228 if [ -n "$prog" ]; then
233 # Stop any running instances of wmiirc
234 echo Start wmiirc | wmiir write /event || exit 1