2006-02-25 21:36:53 +03:00
|
|
|
#!/bin/sh
|
|
|
|
# configure wmii
|
|
|
|
|
|
|
|
xwrite() {
|
|
|
|
file="$1"; shift
|
|
|
|
echo -n "$@" | wmiir write "$file"
|
|
|
|
}
|
|
|
|
|
|
|
|
proglist() {
|
2006-04-19 18:19:52 +04:00
|
|
|
ls -lL "$@" 2>/dev/null | awk 'NF>2 && $1 ~ /^[^d].*x/ {print $NF}' | sort -u
|
2006-02-25 21:36:53 +03:00
|
|
|
}
|
|
|
|
|
2006-04-12 10:53:06 +04:00
|
|
|
MODKEY=Mod1
|
|
|
|
UP=k
|
|
|
|
DOWN=j
|
|
|
|
LEFT=h
|
|
|
|
RIGHT=l
|
|
|
|
|
2006-04-19 18:19:52 +04:00
|
|
|
WMII_FONT='fixed'
|
|
|
|
WMII_SELCOLORS='#ffffff #285577 #4c7899'
|
2006-04-27 10:56:27 +04:00
|
|
|
WMII_NORMCOLORS='#222222 #eeeeee #666666'
|
2006-04-27 10:58:12 +04:00
|
|
|
# dark background
|
2006-04-27 10:56:27 +04:00
|
|
|
#WMII_NORMCOLORS='#e0e0e0 #0a0a0a #202020'
|
2006-04-19 18:19:52 +04:00
|
|
|
|
|
|
|
export WMII_FONT WMII_NORMCOLORS WMII_SELCOLORS
|
2006-02-25 21:36:53 +03:00
|
|
|
|
2006-03-22 19:58:04 +03:00
|
|
|
# give wmiiwm a chance to start
|
|
|
|
while :
|
|
|
|
do
|
|
|
|
echo Start wmiirc | wmiir write /event >/dev/null 2>&1 && break
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
|
2006-02-25 21:36:53 +03:00
|
|
|
# WM CONFIGURATION
|
2006-03-23 16:30:00 +03:00
|
|
|
xwrite /def/border 2
|
2006-02-27 17:15:11 +03:00
|
|
|
xwrite /def/font $WMII_FONT
|
2006-02-25 21:36:53 +03:00
|
|
|
xwrite /def/selcolors $WMII_SELCOLORS
|
|
|
|
xwrite /def/normcolors $WMII_NORMCOLORS
|
2006-05-02 23:22:42 +04:00
|
|
|
xwrite /def/colmode default
|
|
|
|
xwrite /def/colwidth 0
|
2006-02-25 21:36:53 +03:00
|
|
|
|
2006-03-10 19:17:59 +03:00
|
|
|
# TAGGING RULES
|
|
|
|
wmiir write /def/rules <<EOF
|
2006-04-11 20:45:40 +04:00
|
|
|
/XMMS.*/ -> ~
|
|
|
|
/Gimp.*/ -> ~
|
2006-04-26 11:32:11 +04:00
|
|
|
/MPlayer.*/ -> ~
|
2006-04-13 16:58:22 +04:00
|
|
|
/.*/ -> !
|
|
|
|
/.*/ -> 1
|
2006-03-10 19:17:59 +03:00
|
|
|
EOF
|
|
|
|
|
2006-02-25 21:36:53 +03:00
|
|
|
# MISC
|
2006-04-27 12:10:39 +04:00
|
|
|
xsetroot -solid '#333333'
|
2006-02-25 21:36:53 +03:00
|
|
|
status &
|
2006-04-14 12:59:49 +04:00
|
|
|
PROGS_FILE=/tmp/.wmiimenu.$USER.progs
|
2006-04-19 18:19:52 +04:00
|
|
|
proglist `echo "$PATH" | tr : ' '` >$PROGS_FILE &
|
2006-02-25 21:36:53 +03:00
|
|
|
|
|
|
|
# SHORTCUTS
|
2006-04-12 13:08:31 +04:00
|
|
|
xwrite /def/grabmod $MODKEY
|
2006-03-10 18:54:07 +03:00
|
|
|
wmiir write /def/keys <<EOF
|
2006-04-12 10:53:06 +04:00
|
|
|
$MODKEY-$LEFT
|
|
|
|
$MODKEY-$RIGHT
|
|
|
|
$MODKEY-$DOWN
|
|
|
|
$MODKEY-$UP
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-space
|
2006-04-07 18:08:17 +04:00
|
|
|
$MODKEY-d
|
2006-04-24 21:56:47 +04:00
|
|
|
$MODKEY-f
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-s
|
|
|
|
$MODKEY-m
|
|
|
|
$MODKEY-a
|
|
|
|
$MODKEY-p
|
2006-04-11 17:32:03 +04:00
|
|
|
$MODKEY-t
|
2006-03-09 14:00:47 +03:00
|
|
|
$MODKEY-0
|
2006-03-06 01:38:50 +03:00
|
|
|
$MODKEY-1
|
|
|
|
$MODKEY-2
|
|
|
|
$MODKEY-3
|
|
|
|
$MODKEY-4
|
|
|
|
$MODKEY-5
|
|
|
|
$MODKEY-6
|
|
|
|
$MODKEY-7
|
|
|
|
$MODKEY-8
|
|
|
|
$MODKEY-9
|
2006-04-11 17:32:03 +04:00
|
|
|
$MODKEY-Return
|
2006-04-12 10:53:06 +04:00
|
|
|
$MODKEY-Shift-$LEFT
|
|
|
|
$MODKEY-Shift-$RIGHT
|
2006-05-04 16:34:44 +04:00
|
|
|
$MODKEY-Shift-$UP
|
|
|
|
$MODKEY-Shift-$DOWN
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-Shift-space
|
|
|
|
$MODKEY-Shift-c
|
|
|
|
$MODKEY-Shift-t
|
2006-03-09 14:00:47 +03:00
|
|
|
$MODKEY-Shift-0
|
2006-02-26 02:44:27 +03:00
|
|
|
$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
|
2006-04-12 10:53:06 +04:00
|
|
|
$MODKEY-Control-$LEFT
|
|
|
|
$MODKEY-Control-$RIGHT
|
|
|
|
$MODKEY-Control-$DOWN
|
|
|
|
$MODKEY-Control-$UP
|
2006-02-26 02:44:27 +03:00
|
|
|
EOF
|
2006-02-25 21:36:53 +03:00
|
|
|
|
|
|
|
# EVENT LOOP
|
|
|
|
wmiir read /event 2>/dev/null |
|
|
|
|
while read event
|
|
|
|
do
|
|
|
|
set -- $event
|
|
|
|
type="$1"; shift
|
|
|
|
case "$type" in
|
2006-03-13 10:56:22 +03:00
|
|
|
Start)
|
2006-03-22 23:11:57 +03:00
|
|
|
if test wmiirc = "$1"
|
2006-03-13 10:56:22 +03:00
|
|
|
then
|
2006-03-22 18:05:12 +03:00
|
|
|
exit
|
|
|
|
fi;;
|
2006-04-12 13:42:39 +04:00
|
|
|
BarClick)
|
2006-05-04 16:50:19 +04:00
|
|
|
xwrite /ctl view ''"$1"'';;
|
2006-03-10 23:42:39 +03:00
|
|
|
Key)
|
2006-02-25 21:36:53 +03:00
|
|
|
case "$1" in
|
2006-04-12 10:53:06 +04:00
|
|
|
$MODKEY-$LEFT)
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /view/ctl select prev;;
|
2006-04-12 10:53:06 +04:00
|
|
|
$MODKEY-$RIGHT)
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /view/ctl select next;;
|
2006-04-12 16:14:34 +04:00
|
|
|
$MODKEY-$DOWN)
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /view/sel/ctl select next;;
|
2006-04-12 10:53:06 +04:00
|
|
|
$MODKEY-$UP)
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /view/sel/ctl select prev;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-space)
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /view/ctl select toggle;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-d)
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /view/sel/mode default;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-s)
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /view/sel/mode stack;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-m)
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /view/sel/mode max;;
|
2006-04-24 21:56:47 +04:00
|
|
|
$MODKEY-f)
|
|
|
|
xwrite /view/0/sel/geom 0 0 east south;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-a)
|
2006-04-25 20:35:54 +04:00
|
|
|
PATH=$HOME/.wmii-3:CONFPREFIX/wmii-3:$PATH `proglist CONFPREFIX/wmii-3 $HOME/.wmii-3 | wmiimenu` &;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-p)
|
2006-04-14 12:59:49 +04:00
|
|
|
`wmiimenu <$PROGS_FILE` &;;
|
2006-04-11 17:32:03 +04:00
|
|
|
$MODKEY-t)
|
2006-04-13 19:43:57 +04:00
|
|
|
xwrite /ctl view "`wmiir read /tags | wmiimenu`" &;;
|
2006-03-06 01:38:50 +03:00
|
|
|
$MODKEY-[0-9])
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /ctl view `echo $1 | sed 's/.*-//'`;;
|
2006-04-11 17:32:03 +04:00
|
|
|
$MODKEY-Return)
|
2006-04-14 12:28:10 +04:00
|
|
|
xterm &;;
|
2006-04-12 17:29:03 +04:00
|
|
|
$MODKEY-Shift-$LEFT)
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /view/sel/sel/ctl sendto prev;;
|
2006-04-12 17:29:03 +04:00
|
|
|
$MODKEY-Shift-$RIGHT)
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /view/sel/sel/ctl sendto next;;
|
2006-05-04 16:34:44 +04:00
|
|
|
$MODKEY-Shift-$DOWN)
|
|
|
|
xwrite /view/sel/sel/ctl swap down;;
|
|
|
|
$MODKEY-Shift-$UP)
|
|
|
|
xwrite /view/sel/sel/ctl swap up;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-Shift-space)
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /view/sel/sel/ctl sendto toggle;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-Shift-c)
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /view/sel/sel/ctl kill;;
|
2006-03-24 17:00:53 +03:00
|
|
|
$MODKEY-Shift-t)
|
2006-05-04 16:50:19 +04:00
|
|
|
xwrite /view/sel/sel/tags ''"`wmiir read /tags | wmiimenu`"'' &;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-Shift-[0-9])
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /view/sel/sel/tags `echo $1 | sed 's/.*-//'`;;
|
2006-04-12 10:53:06 +04:00
|
|
|
$MODKEY-Control-$LEFT)
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /view/sel/sel/ctl swap prev;;
|
2006-04-12 10:53:06 +04:00
|
|
|
$MODKEY-Control-$RIGHT)
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /view/sel/sel/ctl swap next;;
|
2006-04-12 10:53:06 +04:00
|
|
|
$MODKEY-Control-$DOWN)
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /view/sel/sel/ctl swap down;;
|
2006-04-12 10:53:06 +04:00
|
|
|
$MODKEY-Control-$UP)
|
2006-04-13 12:06:07 +04:00
|
|
|
xwrite /view/sel/sel/ctl swap up;;
|
2006-02-25 21:36:53 +03:00
|
|
|
esac;;
|
|
|
|
esac
|
2006-05-11 03:24:21 +04:00
|
|
|
done &
|