2006-02-25 19:12:09 +01:00
|
|
|
#!/usr/local/plan9/bin/rc
|
2005-12-12 16:08:16 +02:00
|
|
|
# configure wmii
|
2006-03-10 17:51:21 +00:00
|
|
|
fn xwrite {a=$1; shift; echo -n $* | wmiir write $a}
|
2005-12-12 16:08:16 +02:00
|
|
|
|
2006-02-10 09:13:35 +01:00
|
|
|
MODKEY=Alt
|
2006-02-18 22:23:49 +02:00
|
|
|
WMII_FONT='fixed'
|
|
|
|
WMII_NORMCOLORS='#222222 #eeeeee #666666'
|
|
|
|
WMII_SELCOLORS='#ffffff #285577 #4c7899'
|
2005-12-12 16:08:16 +02:00
|
|
|
|
2006-02-11 14:07:36 +01:00
|
|
|
# WM CONFIGURATION
|
2006-03-10 17:51:21 +00:00
|
|
|
xwrite /def/border 3
|
2006-02-10 17:13:26 +01:00
|
|
|
xwrite /def/snap 20
|
2006-02-10 18:32:35 +01:00
|
|
|
xwrite /def/font $WMII_FONT
|
|
|
|
xwrite /def/selcolors $WMII_SELCOLORS
|
|
|
|
xwrite /def/normcolors $WMII_NORMCOLORS
|
2006-03-10 17:51:21 +00:00
|
|
|
xwrite /ws/tag 1
|
|
|
|
|
|
|
|
# TAGGING RULES
|
|
|
|
wmiir write /def/rules <<END
|
|
|
|
/XMMS:.*/ -> ~0
|
|
|
|
/Gimp.*:.*/ -> ~3
|
|
|
|
END
|
2005-12-12 16:08:16 +02:00
|
|
|
|
2006-02-11 14:07:36 +01:00
|
|
|
# BAR CONFIGURATION
|
2006-03-10 23:50:49 +00:00
|
|
|
wmiir create /bar/spare
|
|
|
|
xwrite /bar/spare/colors $WMII_SELCOLORS
|
|
|
|
xwrite /bar/expand spare
|
2006-02-10 17:13:26 +01:00
|
|
|
|
2006-02-11 14:07:36 +01:00
|
|
|
# MENU CONFIGURATION
|
2006-03-10 17:51:21 +00:00
|
|
|
fn items {ls -lpL $* | awk '!/^d/ && $1 ~ /x/ {print $NF}'| sort | uniq}
|
|
|
|
items `{echo $OLD_PATH | sed 's/:/ /g'} >/tmp/ns.$USER.$DISPLAY/p.menu &
|
2006-02-08 17:59:57 +01:00
|
|
|
|
2005-12-12 16:08:16 +02:00
|
|
|
# MISC
|
2006-02-13 10:31:38 +01:00
|
|
|
xsetroot -solid '#0b1014'
|
2006-02-10 09:13:35 +01:00
|
|
|
status &
|
2006-02-09 19:40:12 +01:00
|
|
|
|
2006-02-19 11:13:35 +00:00
|
|
|
# KEYS CONFIGURATION
|
2006-03-10 18:48:29 +00:00
|
|
|
wmiir write /def/keys <<END
|
|
|
|
$MODKEY-Control-c
|
|
|
|
$MODKEY-Control-w,y
|
|
|
|
$MODKEY-Control-q,y
|
|
|
|
$MODKEY-Control-p
|
|
|
|
$MODKEY-Control-a
|
|
|
|
$MODKEY-Shift-Return
|
|
|
|
$MODKEY-Shift-space
|
|
|
|
$MODKEY-Shift-0
|
|
|
|
$MODKEY-Shift-1
|
|
|
|
$MODKEY-Shift-2
|
|
|
|
$MODKEY-Shift-3
|
|
|
|
$MODKEY-Shift-4
|
|
|
|
$MODKEY-Shift-5
|
|
|
|
$MODKEY-Shift-6
|
|
|
|
$MODKEY-Shift-7
|
|
|
|
$MODKEY-Shift-8
|
|
|
|
$MODKEY-Shift-9
|
|
|
|
$MODKEY-t
|
|
|
|
$MODKEY-Return
|
|
|
|
$MODKEY-space
|
|
|
|
$MODKEY-h
|
|
|
|
$MODKEY-l
|
|
|
|
$MODKEY-j
|
|
|
|
$MODKEY-k
|
|
|
|
$MODKEY-Tab
|
|
|
|
$MODKEY-m
|
|
|
|
$MODKEY-s
|
|
|
|
$MODKEY-e
|
|
|
|
$MODKEY-n
|
|
|
|
$MODKEY-0
|
|
|
|
$MODKEY-1
|
|
|
|
$MODKEY-2
|
|
|
|
$MODKEY-3
|
|
|
|
$MODKEY-4
|
|
|
|
$MODKEY-5
|
|
|
|
$MODKEY-6
|
|
|
|
$MODKEY-7
|
|
|
|
$MODKEY-8
|
|
|
|
$MODKEY-9
|
|
|
|
END
|
2006-02-19 11:13:35 +00:00
|
|
|
|
2006-02-10 17:13:26 +01:00
|
|
|
# EVENT LOOP
|
2006-03-10 17:51:21 +00:00
|
|
|
oldt=''
|
|
|
|
wmiir read /event|
|
|
|
|
while(e=`{read}) {
|
|
|
|
switch($e(1)) {
|
2006-03-10 23:50:49 +00:00
|
|
|
case NewTag
|
2006-03-10 17:51:21 +00:00
|
|
|
t=$e(2)
|
|
|
|
wmiir create /bar/$t
|
|
|
|
if(~ $t $olt)
|
|
|
|
xwrite /bar/$"t/colors $WMII_NORMCOLORS
|
|
|
|
if not
|
|
|
|
xwrite /bar/$"t/colors $WMII_SELCOLORS
|
|
|
|
xwrite /bar/$"t/data $e(2)
|
2006-03-10 23:50:49 +00:00
|
|
|
case RemoveTag
|
2006-03-10 17:51:21 +00:00
|
|
|
wmiir remove /bar/$e(2)
|
2006-03-10 23:50:49 +00:00
|
|
|
case FocusTag
|
2006-03-10 17:51:21 +00:00
|
|
|
t=$e(2)
|
|
|
|
if (! ~ $#oldt 0)
|
|
|
|
xwrite /bar/$oldt/colors $WMII_SELCOLORS
|
|
|
|
xwrite /bar/$t/data $e(2)
|
|
|
|
xwrite /bar/$t/colors $WMII_NORMCOLORS
|
|
|
|
oldt=$e(2)
|
2006-03-10 23:50:49 +00:00
|
|
|
case LabelClick
|
2006-03-10 17:51:21 +00:00
|
|
|
xwrite /ctl select $e(2)
|
2006-03-10 23:50:49 +00:00
|
|
|
case Key
|
2006-03-10 17:51:21 +00:00
|
|
|
switch($e(2)) {
|
|
|
|
case $MODKEY-Control-c
|
|
|
|
xwrite /ws/sel/sel/ctl kill
|
|
|
|
case $MODKEY-Control-w,y
|
2006-03-10 23:50:49 +00:00
|
|
|
exec wmiirc
|
2006-03-10 17:51:21 +00:00
|
|
|
case $MODKEY-Control-q,y
|
|
|
|
xwrite /ctl quit
|
|
|
|
case $MODKEY-Control-p
|
|
|
|
extern `{wmiimenu < /tmp/ns.$USER.$DISPLAY/p.menu}&
|
|
|
|
case $MODKEY-Control-a
|
|
|
|
`{items /usr/local/etc/wmii-3 $HOME/.wmii-3 | wmiimenu}&
|
|
|
|
case $MODKEY-t
|
|
|
|
extern xterm&
|
|
|
|
case $MODKEY-m
|
|
|
|
xwrite /ws/sel/mode max
|
|
|
|
case $MODKEY-s
|
|
|
|
xwrite /ws/sel/mode stack
|
|
|
|
case $MODKEY-e
|
|
|
|
xwrite /ws/sel/mode equal
|
|
|
|
case $MODKEY-n
|
|
|
|
xwrite /ws/sel/sel/ctl sendto new
|
|
|
|
case $MODKEY-Return
|
|
|
|
xwrite /ws/sel/sel/ctl sendto prev
|
|
|
|
case $MODKEY-Shift-Return
|
|
|
|
xwrite /ws/sel/sel/ctl sendto next
|
|
|
|
case $MODKEY-space
|
|
|
|
xwrite /ws/sel/sel/ctl sendto 0
|
|
|
|
case $MODKEY-Shift-space
|
|
|
|
xwrite /ws/sel/sel/ctl sendto 1
|
|
|
|
case $MODKEY-h
|
|
|
|
xwrite /ws/ctl select prev
|
|
|
|
case $MODKEY-l
|
|
|
|
xwrite /ws/ctl select next
|
|
|
|
case $MODKEY-Tab
|
|
|
|
xwrite /ws/sel/ctl select next
|
|
|
|
case $MODKEY-j
|
|
|
|
xwrite /ws/sel/ctl select next
|
|
|
|
case $MODKEY-k
|
|
|
|
xwrite /ws/sel/ctl select prev
|
|
|
|
case $MODKEY-[0-9]
|
|
|
|
xwrite /ctl `{echo $e | awk -F- '{print "select "$2}'}
|
|
|
|
|
|
|
|
case $MODKEY-Shift-Return
|
|
|
|
xwrite /ws/sel/sel/ctl sendto next
|
|
|
|
case $MODKEY-Shift-space
|
|
|
|
xwrite /ws/sel/sel/ctl sendto 1
|
|
|
|
case $MODKEY-Shift-[0-9]
|
|
|
|
xwrite /ws/sel/sel/tags ' '`{echo $e | awk -F- '{print $3}'}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} &
|