2006-02-25 21:36:53 +03:00
|
|
|
#!/bin/sh
|
|
|
|
# configure wmii
|
|
|
|
|
|
|
|
pidfile=/tmp/ns.$USER.$DISPLAY/wmiircpid
|
|
|
|
|
|
|
|
xwrite() {
|
|
|
|
file="$1"; shift
|
|
|
|
echo -n "$@" | wmiir write "$file"
|
|
|
|
}
|
|
|
|
|
|
|
|
proglist() {
|
|
|
|
for dir in `echo $@ | sed 's/^:/.:/; s/::/:.:/; s/:$/:./' | tr : ' '`
|
|
|
|
do
|
|
|
|
for i in $dir/*
|
|
|
|
do
|
|
|
|
test -x "$i" && test ! -d "$i" && echo `basename "$i"`
|
|
|
|
done
|
|
|
|
done | sort | uniq
|
|
|
|
}
|
|
|
|
|
2006-03-01 13:30:44 +03:00
|
|
|
test -f $pidfile && kill `cat $pidfile` 2>/dev/null
|
2006-02-25 21:36:53 +03:00
|
|
|
echo $$ >$pidfile
|
|
|
|
|
|
|
|
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-02 16:37:36 +03:00
|
|
|
xwrite /1/1/capacity 1
|
2006-02-25 21:36:53 +03:00
|
|
|
|
|
|
|
# BAR CONFIGURATION
|
2006-03-01 19:30:20 +03:00
|
|
|
while wmiir remove /bar/0 2>/dev/null
|
2006-02-25 21:36:53 +03:00
|
|
|
do
|
2006-02-26 15:54:05 +03:00
|
|
|
:
|
2006-02-25 21:36:53 +03:00
|
|
|
done
|
|
|
|
xwrite /bar/new/colors $WMII_NORMCOLORS
|
|
|
|
xwrite /bar/new/colors $WMII_SELCOLORS
|
2006-03-01 13:09:49 +03:00
|
|
|
xwrite /bar/0/data 1
|
2006-03-04 11:23:17 +03:00
|
|
|
xwrite /bar/expand 1
|
2006-02-25 21:36:53 +03:00
|
|
|
|
|
|
|
# MISC
|
|
|
|
xsetroot -solid '#0b1014'
|
|
|
|
status &
|
|
|
|
proglist $OLD_PATH >/tmp/ns.$USER.$DISPLAY/progs &
|
|
|
|
|
|
|
|
# SHORTCUTS
|
2006-02-26 02:44:27 +03:00
|
|
|
while read key
|
2006-02-25 21:36:53 +03:00
|
|
|
do
|
|
|
|
echo -n | wmiir create /keys/$key
|
2006-02-26 02:44:27 +03:00
|
|
|
done <<EOF
|
|
|
|
$MODKEY-Control-c
|
|
|
|
$MODKEY-Control-w,y
|
|
|
|
$MODKEY-Control-q,y
|
2006-03-01 19:30:20 +03:00
|
|
|
$MODKEY-Control-r
|
2006-02-26 02:44:27 +03:00
|
|
|
$MODKEY-Control-p
|
|
|
|
$MODKEY-Control-a
|
|
|
|
$MODKEY-Control-y
|
|
|
|
$MODKEY-t
|
|
|
|
$MODKEY-n
|
|
|
|
$MODKEY-Return
|
|
|
|
$MODKEY-h
|
|
|
|
$MODKEY-l
|
|
|
|
$MODKEY-j
|
|
|
|
$MODKEY-k
|
|
|
|
$MODKEY-Tab
|
2006-03-01 18:47:43 +03:00
|
|
|
$MODKEY-Shift-m
|
2006-02-28 19:13:16 +03:00
|
|
|
$MODKEY-Shift-s
|
|
|
|
$MODKEY-Shift-equal
|
2006-02-26 02:44:27 +03:00
|
|
|
$MODKEY-Shift-h
|
|
|
|
$MODKEY-Shift-l
|
|
|
|
$MODKEY-Shift-Return
|
2006-03-01 13:09:49 +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-03-01 13:09:49 +03:00
|
|
|
$MODKEY-d
|
|
|
|
$MODKEY-a
|
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
|
|
|
|
PN)
|
2006-03-01 13:09:49 +03:00
|
|
|
xwrite /bar/0/data "$@";;
|
2006-02-25 21:36:53 +03:00
|
|
|
LB)
|
|
|
|
case "$2" in
|
|
|
|
1)
|
2006-03-04 11:23:17 +03:00
|
|
|
xwrite /ctl select prev;;
|
2006-02-25 21:36:53 +03:00
|
|
|
3|4)
|
|
|
|
xwrite /ctl select next;;
|
|
|
|
5)
|
|
|
|
xwrite /ctl select prev;;
|
|
|
|
esac;;
|
|
|
|
K)
|
|
|
|
case "$1" in
|
|
|
|
$MODKEY-Control-c)
|
|
|
|
xwrite /sel/sel/sel/ctl kill;;
|
|
|
|
$MODKEY-Control-w,y)
|
|
|
|
wmiirc &;;
|
|
|
|
$MODKEY-Control-q,y)
|
|
|
|
xwrite /ctl quit;;
|
2006-03-01 19:30:20 +03:00
|
|
|
$MODKEY-Control-r)
|
2006-02-28 16:58:55 +03:00
|
|
|
wmiir remove /sel;;
|
2006-02-25 21:36:53 +03:00
|
|
|
$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-01 18:59:42 +03:00
|
|
|
extern xterm -rv&;;
|
2006-02-25 21:36:53 +03:00
|
|
|
$MODKEY-n)
|
|
|
|
wmiir read /sel/new >/dev/null;;
|
2006-03-01 18:47:43 +03:00
|
|
|
$MODKEY-Shift-m)
|
|
|
|
xwrite /sel/sel/mode max;;
|
2006-02-28 19:13:16 +03:00
|
|
|
$MODKEY-Shift-s)
|
2006-03-01 09:51:04 +03:00
|
|
|
xwrite /sel/sel/mode stack;;
|
2006-02-28 19:13:16 +03:00
|
|
|
$MODKEY-Shift-equal)
|
2006-03-01 09:51:04 +03:00
|
|
|
xwrite /sel/sel/mode equal;;
|
2006-02-25 21:36:53 +03:00
|
|
|
$MODKEY-Return)
|
2006-02-26 14:06:23 +03:00
|
|
|
xwrite /sel/sel/sel/ctl sendtoarea prev;;
|
2006-02-25 21:36:53 +03:00
|
|
|
$MODKEY-Shift-Return)
|
|
|
|
xwrite /sel/sel/sel/ctl sendtoarea next;;
|
|
|
|
$MODKEY-Control-y)
|
2006-03-02 16:37:36 +03:00
|
|
|
xwrite /new/1/capacity 1;;
|
2006-02-25 21:36:53 +03:00
|
|
|
$MODKEY-h)
|
|
|
|
xwrite /sel/ctl select prev;;
|
|
|
|
$MODKEY-l)
|
|
|
|
xwrite /sel/ctl select next;;
|
|
|
|
$MODKEY-Tab)
|
|
|
|
xwrite /sel/sel/ctl select next;;
|
|
|
|
$MODKEY-j)
|
|
|
|
xwrite /sel/sel/ctl select next;;
|
|
|
|
$MODKEY-k)
|
|
|
|
xwrite /sel/sel/ctl select prev;;
|
|
|
|
$MODKEY-Shift-h)
|
|
|
|
xwrite /ctl select prev;;
|
|
|
|
$MODKEY-Shift-l)
|
|
|
|
xwrite /ctl select next;;
|
2006-03-01 13:09:49 +03:00
|
|
|
$MODKEY-Shift-[0-9])
|
2006-02-25 21:36:53 +03:00
|
|
|
xwrite /ctl select `echo $1 | sed 's/.*-//'`;;
|
2006-03-01 13:09:49 +03:00
|
|
|
$MODKEY-d)
|
|
|
|
xwrite /sel/sel/sel/ctl sendtopage 0;;
|
|
|
|
$MODKEY-a)
|
|
|
|
xwrite /0/sel/sel/ctl sendtopage sel;;
|
2006-02-25 21:36:53 +03:00
|
|
|
esac;;
|
|
|
|
esac
|
|
|
|
done &
|
|
|
|
echo $! >$pidfile
|