2006-02-25 21:36:53 +03:00
|
|
|
#!/bin/sh
|
|
|
|
# configure wmii
|
|
|
|
|
|
|
|
xwrite() {
|
|
|
|
file="$1"; shift
|
|
|
|
echo -n "$@" | wmiir write "$file"
|
|
|
|
}
|
|
|
|
|
|
|
|
proglist() {
|
2006-03-22 18:05:12 +03:00
|
|
|
ls -lL `echo "$@" 2>/dev/null | tr : ' '` |
|
|
|
|
awk 'NF>2 && !/^d/ && $1 ~ /x/ {print $NF}' | sort -u
|
2006-02-25 21:36:53 +03:00
|
|
|
}
|
|
|
|
|
2006-03-12 12:16:04 +03:00
|
|
|
# give wmiiwm a chance to start
|
2006-03-22 18:05:12 +03:00
|
|
|
while ! echo Start wmiirc | wmiir write /event >/dev/null 2>&1
|
2006-03-13 10:56:22 +03:00
|
|
|
do
|
2006-03-12 12:16:04 +03:00
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
|
2006-03-16 10:24:04 +03:00
|
|
|
MODKEY=Alt
|
2006-02-27 17:15:11 +03:00
|
|
|
WMII_FONT='fixed' export WMII_FONT
|
2006-02-25 21:36:53 +03:00
|
|
|
WMII_NORMCOLORS='#222222 #eeeeee #666666' export WMII_NORMCOLORS
|
|
|
|
WMII_SELCOLORS='#ffffff #285577 #4c7899' export WMII_SELCOLORS
|
|
|
|
|
|
|
|
# WM CONFIGURATION
|
|
|
|
xwrite /def/border 3
|
|
|
|
xwrite /def/snap 20
|
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-03-10 00:45:21 +03:00
|
|
|
xwrite /ws/tag 1
|
2006-02-25 21:36:53 +03:00
|
|
|
|
2006-03-10 19:17:59 +03:00
|
|
|
# TAGGING RULES
|
|
|
|
wmiir write /def/rules <<EOF
|
2006-03-13 22:27:33 +03:00
|
|
|
/XMMS:.*/ -> ~
|
|
|
|
/Gimp.*:.*/ -> ~
|
2006-03-10 19:17:59 +03:00
|
|
|
EOF
|
|
|
|
|
2006-02-25 21:36:53 +03:00
|
|
|
# BAR CONFIGURATION
|
2006-03-11 01:42:43 +03:00
|
|
|
wmiir create /bar/spare
|
|
|
|
xwrite /bar/spare/colors $WMII_SELCOLORS
|
|
|
|
xwrite /bar/expand spare
|
2006-02-25 21:36:53 +03:00
|
|
|
|
|
|
|
# MISC
|
|
|
|
xsetroot -solid '#0b1014'
|
|
|
|
status &
|
|
|
|
proglist $OLD_PATH >/tmp/ns.$USER.$DISPLAY/progs &
|
|
|
|
|
|
|
|
# SHORTCUTS
|
2006-03-10 18:54:07 +03:00
|
|
|
wmiir write /def/keys <<EOF
|
2006-02-26 02:44:27 +03:00
|
|
|
$MODKEY-Control-c
|
|
|
|
$MODKEY-Control-w,y
|
|
|
|
$MODKEY-Control-q,y
|
|
|
|
$MODKEY-Control-p
|
|
|
|
$MODKEY-Control-a
|
|
|
|
$MODKEY-t
|
|
|
|
$MODKEY-Return
|
2006-03-05 22:00:18 +03:00
|
|
|
$MODKEY-Shift-Return
|
2006-03-09 15:27:44 +03:00
|
|
|
$MODKEY-space
|
|
|
|
$MODKEY-Shift-space
|
2006-02-26 02:44:27 +03:00
|
|
|
$MODKEY-h
|
|
|
|
$MODKEY-l
|
|
|
|
$MODKEY-j
|
|
|
|
$MODKEY-k
|
|
|
|
$MODKEY-Tab
|
2006-03-05 22:00:18 +03:00
|
|
|
$MODKEY-n
|
|
|
|
$MODKEY-m
|
|
|
|
$MODKEY-s
|
2006-03-10 18:23:13 +03:00
|
|
|
$MODKEY-e
|
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-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
|
|
|
|
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 18:05:12 +03:00
|
|
|
if test "$1" = wmiirc
|
2006-03-13 10:56:22 +03:00
|
|
|
then
|
2006-03-22 18:05:12 +03:00
|
|
|
exit
|
|
|
|
fi;;
|
2006-03-10 23:42:39 +03:00
|
|
|
NewTag)
|
2006-03-09 04:15:43 +03:00
|
|
|
wmiir create /bar/$1
|
2006-03-22 18:05:12 +03:00
|
|
|
if test "$1" = "$oldtag"
|
2006-03-09 14:00:47 +03:00
|
|
|
then
|
|
|
|
xwrite /bar/$1/colors $WMII_NORMCOLORS
|
|
|
|
else
|
|
|
|
xwrite /bar/$1/colors $WMII_SELCOLORS
|
|
|
|
fi
|
2006-03-09 04:15:43 +03:00
|
|
|
xwrite /bar/$1/data $1;;
|
2006-03-10 23:42:39 +03:00
|
|
|
RemoveTag)
|
2006-03-09 04:15:43 +03:00
|
|
|
wmiir remove /bar/$1;;
|
2006-03-10 23:42:39 +03:00
|
|
|
FocusTag)
|
2006-03-09 14:00:47 +03:00
|
|
|
if test -n "$oldtag"
|
2006-03-09 04:15:43 +03:00
|
|
|
then
|
2006-03-09 14:00:47 +03:00
|
|
|
xwrite /bar/$oldtag/colors $WMII_SELCOLORS
|
2006-03-09 04:15:43 +03:00
|
|
|
fi
|
2006-03-22 18:05:12 +03:00
|
|
|
xwrite /bar/$1/data $1
|
2006-03-09 04:43:20 +03:00
|
|
|
xwrite /bar/$1/colors $WMII_NORMCOLORS
|
2006-03-09 14:00:47 +03:00
|
|
|
oldtag=$1;;
|
2006-03-10 23:42:39 +03:00
|
|
|
LabelClick)
|
2006-03-09 18:23:18 +03:00
|
|
|
xwrite /ctl select $1;;
|
2006-03-10 23:42:39 +03:00
|
|
|
Key)
|
2006-02-25 21:36:53 +03:00
|
|
|
case "$1" in
|
|
|
|
$MODKEY-Control-c)
|
2006-03-05 22:00:18 +03:00
|
|
|
xwrite /ws/sel/sel/ctl kill;;
|
2006-02-25 21:36:53 +03:00
|
|
|
$MODKEY-Control-w,y)
|
2006-03-22 18:05:12 +03:00
|
|
|
exec wmiirc;;
|
2006-02-25 21:36:53 +03:00
|
|
|
$MODKEY-Control-q,y)
|
|
|
|
xwrite /ctl quit;;
|
|
|
|
$MODKEY-Control-p)
|
|
|
|
extern `wmiimenu </tmp/ns.$USER.$DISPLAY/progs` &;;
|
|
|
|
$MODKEY-Control-a)
|
|
|
|
`proglist CONFPREFIX/wmii-3:$HOME/.wmii-3 | wmiimenu` &;;
|
|
|
|
$MODKEY-t)
|
2006-03-04 11:29:20 +03:00
|
|
|
extern xterm &;;
|
2006-03-05 22:00:18 +03:00
|
|
|
$MODKEY-m)
|
|
|
|
xwrite /ws/sel/mode max;;
|
|
|
|
$MODKEY-s)
|
|
|
|
xwrite /ws/sel/mode stack;;
|
2006-03-10 18:23:13 +03:00
|
|
|
$MODKEY-e)
|
2006-03-05 22:00:18 +03:00
|
|
|
xwrite /ws/sel/mode equal;;
|
2006-02-25 21:36:53 +03:00
|
|
|
$MODKEY-n)
|
2006-03-08 18:05:09 +03:00
|
|
|
xwrite /ws/sel/sel/ctl sendto new;;
|
2006-02-25 21:36:53 +03:00
|
|
|
$MODKEY-Return)
|
2006-03-08 18:05:09 +03:00
|
|
|
xwrite /ws/sel/sel/ctl sendto prev;;
|
2006-02-25 21:36:53 +03:00
|
|
|
$MODKEY-Shift-Return)
|
2006-03-08 18:05:09 +03:00
|
|
|
xwrite /ws/sel/sel/ctl sendto next;;
|
2006-03-09 15:27:44 +03:00
|
|
|
$MODKEY-space)
|
2006-03-11 22:50:53 +03:00
|
|
|
xwrite /ws/ctl select toggle;;
|
2006-03-09 15:27:44 +03:00
|
|
|
$MODKEY-Shift-space)
|
2006-03-11 22:37:29 +03:00
|
|
|
xwrite /ws/sel/sel/ctl sendto toggle;;
|
2006-02-25 21:36:53 +03:00
|
|
|
$MODKEY-h)
|
2006-03-05 22:00:18 +03:00
|
|
|
xwrite /ws/ctl select prev;;
|
2006-02-25 21:36:53 +03:00
|
|
|
$MODKEY-l)
|
2006-03-05 22:00:18 +03:00
|
|
|
xwrite /ws/ctl select next;;
|
2006-02-25 21:36:53 +03:00
|
|
|
$MODKEY-Tab)
|
2006-03-05 22:00:18 +03:00
|
|
|
xwrite /ws/sel/ctl select next;;
|
2006-02-25 21:36:53 +03:00
|
|
|
$MODKEY-j)
|
2006-03-05 22:00:18 +03:00
|
|
|
xwrite /ws/sel/ctl select next;;
|
2006-02-25 21:36:53 +03:00
|
|
|
$MODKEY-k)
|
2006-03-05 22:00:18 +03:00
|
|
|
xwrite /ws/sel/ctl select prev;;
|
2006-03-06 01:38:50 +03:00
|
|
|
$MODKEY-[0-9])
|
2006-02-25 21:36:53 +03:00
|
|
|
xwrite /ctl select `echo $1 | sed 's/.*-//'`;;
|
2006-03-08 14:12:04 +03:00
|
|
|
$MODKEY-Shift-[0-9])
|
|
|
|
xwrite /ws/sel/sel/tags `echo $1 | sed 's/.*-//'`;;
|
2006-02-25 21:36:53 +03:00
|
|
|
esac;;
|
|
|
|
esac
|
2006-03-22 18:05:12 +03:00
|
|
|
done
|