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-*-*-13-*-*-*-*-*-*-*'
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"
24 wmiir
write /colrules
<<!
29 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 wmiir xwrite
/ctl
exec "$@"
78 proglist
$PATH >$progsfile
81 if wmiir remove
/rbar
/status
2>/dev
/null
; then
84 echo "$WMII_NORMCOLORS" | wmiir create
/rbar
/status
85 while status | wmiir
write /rbar
/status
; do
92 do=$
($WMII_9MENU -initial "${menulast:-SomeRandomName}" Nop Delete
)
95 wmiir xwrite
/client
/$client/ctl
kill
97 menulast
=${do:-"$menulast"}
100 Key
$MODKEY-Control-t
101 case $
(wmiir
read /keys |
wc -l |
tr -d ' \t\n') in
103 echo -n \
$Keys |
tr ' ' '\012' | wmiir
write /keys
104 wmiir xwrite
/ctl grabmod
$MODKEY;;
106 wmiir xwrite
/keys
$MODKEY-Control-t
107 wmiir xwrite
/ctl grabmod Mod3
;;
110 wmiir xwrite
/tag
/sel
/ctl
select toggle
112 wmiir xwrite
/tag
/sel
/ctl colmode sel default
114 wmiir xwrite
/tag
/sel
/ctl colmode sel stack
116 wmiir xwrite
/tag
/sel
/ctl colmode sel max
118 Action $
(actionlist |
$WMII_MENU) &
120 sh
-c "$($WMII_MENU <$progsfile)" &
122 wmiir xwrite
/ctl
"view $(tagsmenu)" &
125 Key
$MODKEY-Shift-space
126 wmiir xwrite
/tag
/sel
/ctl send sel toggle
128 wmiir xwrite
/client
/sel
/ctl
kill
130 wmiir xwrite
"/client/$(wmiir read /client/sel/ctl)/tags" "$(tagsmenu)" &
132 wmiir xwrite
/tag
/sel
/ctl
select left
134 wmiir xwrite
/tag
/sel
/ctl
select right
136 wmiir xwrite
/tag
/sel
/ctl
select down
138 wmiir xwrite
/tag
/sel
/ctl
select up
139 Key
$MODKEY-Shift-$LEFT
140 wmiir xwrite
/tag
/sel
/ctl send sel left
141 Key
$MODKEY-Shift-$RIGHT
142 wmiir xwrite
/tag
/sel
/ctl send sel right
143 Key
$MODKEY-Shift-$DOWN
144 wmiir xwrite
/tag
/sel
/ctl send sel down
145 Key
$MODKEY-Shift-$UP
146 wmiir xwrite
/tag
/sel
/ctl send sel up
148 for i
in 0 1 2 3 4 5 6 7 8 9; do
151 wmiir xwrite
/ctl view
"$i"
153 wmiir xwrite
/client
/sel
/tags
"$i"
159 wmiir
write /ctl
<< EOF
161 focuscolors $WMII_FOCUSCOLORS
162 normcolors $WMII_NORMCOLORS
167 export WMII_MENU WMII_9MENU WMII_FONT WMII_TERM
168 export WMII_FOCUSCOLORS WMII_SELCOLORS WMII_NORMCOLORS
170 # Feed events to `wmiiloop' for processing
171 eval "$(eventstuff | sed 's/^[ ]//' | { . wmiiloop; })"
173 echo "$Keys" |
tr ' ' '\n' | wmiir
write /keys
178 if [ -n "$action" ]; then
179 Action_
$action "$@" \
180 || conf_which
$action "$@"
185 paths
=$
(echo "$@" |
sed 'y/:/ /')
186 ls -lL $paths 2>/dev
/null \
187 |
awk '$1 ~ /^[^d].*x/ { print $NF }' \
192 progsfile
="$WMII_NS_DIR/.proglist"
194 proglist
$PATH >$progsfile &
196 xsetroot
-solid "$WMII_BACKGROUND" &
199 seltag
="$(wmiir read /tag/sel/ctl 2>/dev/null)"
202 wmiir remove
"/lbar/$bar"
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); shift
227 [ -n "$prog" ] && $prog "$@"
230 # Stop any running instances of wmiirc
231 echo Start wmiirc | wmiir
write /event ||
exit 1