2006-11-04 01:00:23 +03:00
|
|
|
#!/bin/sh
|
2006-02-25 21:36:53 +03:00
|
|
|
# configure wmii
|
|
|
|
|
|
|
|
xwrite() {
|
|
|
|
file="$1"; shift
|
2006-10-12 18:22:28 +04:00
|
|
|
echo -n "$@" | ixpc write "$file"
|
2006-02-25 21:36:53 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
proglist() {
|
2006-06-24 13:15:41 +04:00
|
|
|
ls -lL "$@" 2>/dev/null | awk 'NF>2 && $1 ~ /^[^d].*x/ {print $NF}' | sort | uniq
|
|
|
|
}
|
|
|
|
|
|
|
|
conf_which () {
|
|
|
|
prog=$1; shift
|
2006-06-30 00:00:07 +04:00
|
|
|
echo `PATH="$WMII_CONFPATH:$PATH" which $prog` "$@"
|
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-11-04 01:00:23 +03:00
|
|
|
DMENU='dmenu -font fixed -normbg #eeeeee -normfg #222222 -selbg #335577 -selfg #ffffff'
|
2006-12-13 13:26:38 +03:00
|
|
|
WMII_FONT='-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*'
|
2006-11-04 01:00:23 +03:00
|
|
|
WMII_NORMCOLORS='#222222 #eeeeee #666666'
|
|
|
|
WMII_SELCOLORS='#ffffff #335577 #447799'
|
|
|
|
# dark background
|
|
|
|
#WMII_NORMCOLORS='#eeeeee #111111 #222222'
|
2006-02-25 21:36:53 +03:00
|
|
|
|
2006-11-04 01:00:23 +03:00
|
|
|
export DMENU WMII_FONT WMII_SELCOLORS WMII_NORMCOLORS
|
2006-10-30 11:54:22 +03:00
|
|
|
|
2006-11-04 01:00:23 +03:00
|
|
|
# stop any running instances or ixpcc
|
|
|
|
echo Start ixpcc | ixpc write /event || exit 1
|
2006-03-22 19:58:04 +03:00
|
|
|
|
2006-02-25 21:36:53 +03:00
|
|
|
# WM CONFIGURATION
|
2006-10-12 18:22:28 +04:00
|
|
|
ixpc write /ctl << EOF
|
2006-06-21 06:06:02 +04:00
|
|
|
font $WMII_FONT
|
|
|
|
selcolors $WMII_SELCOLORS
|
|
|
|
normcolors $WMII_NORMCOLORS
|
2006-06-21 06:52:40 +04:00
|
|
|
grabmod $MODKEY
|
2006-06-21 22:48:39 +04:00
|
|
|
border 2
|
2006-06-21 06:06:02 +04:00
|
|
|
EOF
|
2006-05-31 21:48:44 +04:00
|
|
|
|
|
|
|
# COLUMN RULES
|
2006-10-12 18:22:28 +04:00
|
|
|
ixpc write /colrules <<EOF
|
2006-06-06 19:35:29 +04:00
|
|
|
/1/ -> 50+50
|
2006-05-31 11:51:40 +04:00
|
|
|
EOF
|
2006-02-25 21:36:53 +03:00
|
|
|
|
2006-03-10 19:17:59 +03:00
|
|
|
# TAGGING RULES
|
2006-10-12 18:22:28 +04:00
|
|
|
ixpc write /tagrules <<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-11-04 01:00:23 +03:00
|
|
|
xsetroot -solid '#333333'
|
2006-06-24 13:15:41 +04:00
|
|
|
`conf_which status` &
|
2006-09-27 19:40:39 +04:00
|
|
|
PROGS_FILE="$WMII_NS_DIR/.dmenu.proglist"
|
2006-06-24 14:45:27 +04:00
|
|
|
ACTIONS_DIRS=`echo "$WMII_CONFPATH" | tr : ' '`
|
|
|
|
proglist `echo "$PATH" | tr : ' '` >$PROGS_FILE &
|
2006-02-25 21:36:53 +03:00
|
|
|
|
|
|
|
# SHORTCUTS
|
2006-10-12 18:22:28 +04:00
|
|
|
ixpc write /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
|
|
|
|
EOF
|
2006-02-25 21:36:53 +03:00
|
|
|
|
2006-06-20 06:40:45 +04:00
|
|
|
# TAG BAR
|
2006-10-12 18:22:28 +04:00
|
|
|
ixpc ls /lbar |
|
2006-06-30 00:00:07 +04:00
|
|
|
while read bar
|
2006-06-22 01:12:02 +04:00
|
|
|
do
|
2006-10-12 18:22:28 +04:00
|
|
|
ixpc remove "/lbar/$bar"
|
2006-06-22 01:12:02 +04:00
|
|
|
done
|
|
|
|
|
2006-10-12 18:22:28 +04:00
|
|
|
seltag="`ixpc read /tag/sel/ctl 2>/dev/null`"
|
|
|
|
ixpc ls /tag | sed -e 's,/$,,; /^sel$/d' |
|
2006-06-30 00:00:07 +04:00
|
|
|
while read tag
|
2006-06-20 06:40:45 +04:00
|
|
|
do
|
|
|
|
if [ "X$tag" = "X$seltag" ]; then
|
2006-10-12 18:22:28 +04:00
|
|
|
echo "$WMII_SELCOLORS" "$tag" | ixpc create "/lbar/$tag"
|
2006-06-20 06:40:45 +04:00
|
|
|
else
|
2006-10-12 18:22:28 +04:00
|
|
|
echo "$WMII_NORMCOLORS" "$tag" | ixpc create "/lbar/$tag"
|
2006-06-20 06:40:45 +04:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2006-02-25 21:36:53 +03:00
|
|
|
# EVENT LOOP
|
2006-10-12 18:22:28 +04:00
|
|
|
ixpc read /event 2>/dev/null |
|
2006-02-25 21:36:53 +03:00
|
|
|
while read event
|
|
|
|
do
|
2006-05-26 18:43:52 +04:00
|
|
|
set -f
|
2006-02-25 21:36:53 +03:00
|
|
|
set -- $event
|
2006-05-26 18:43:52 +04:00
|
|
|
set +f
|
2006-02-25 21:36:53 +03:00
|
|
|
type="$1"; shift
|
2006-06-30 02:03:35 +04:00
|
|
|
parms="$@"
|
2006-02-25 21:36:53 +03:00
|
|
|
case "$type" in
|
2006-03-13 10:56:22 +03:00
|
|
|
Start)
|
2006-11-04 01:00:23 +03:00
|
|
|
if test ixpcc = "$1"
|
2006-03-13 10:56:22 +03:00
|
|
|
then
|
2006-03-22 18:05:12 +03:00
|
|
|
exit
|
|
|
|
fi;;
|
2006-06-06 23:10:30 +04:00
|
|
|
CreateTag)
|
2006-10-12 18:22:28 +04:00
|
|
|
echo "$WMII_NORMCOLORS" "$parms" | ixpc create "/lbar/$parms"
|
2006-06-06 23:10:30 +04:00
|
|
|
;;
|
|
|
|
DestroyTag)
|
2006-10-12 18:22:28 +04:00
|
|
|
ixpc remove "/lbar/$parms"
|
2006-06-06 23:10:30 +04:00
|
|
|
;;
|
|
|
|
FocusTag)
|
2006-06-30 02:03:35 +04:00
|
|
|
xwrite "/lbar/$parms" "$WMII_SELCOLORS" "$parms"
|
2006-06-06 23:10:30 +04:00
|
|
|
;;
|
|
|
|
UnfocusTag)
|
2006-06-30 02:03:35 +04:00
|
|
|
xwrite "/lbar/$parms" "$WMII_NORMCOLORS" "$parms"
|
2006-06-06 23:10:30 +04:00
|
|
|
;;
|
2006-06-22 01:12:02 +04:00
|
|
|
LeftBarClick)
|
2006-06-23 08:37:59 +04:00
|
|
|
shift
|
|
|
|
xwrite /ctl view "$@";;
|
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-06-20 02:25:49 +04:00
|
|
|
xwrite /tag/sel/ctl select left;;
|
2006-04-12 10:53:06 +04:00
|
|
|
$MODKEY-$RIGHT)
|
2006-06-20 02:25:49 +04:00
|
|
|
xwrite /tag/sel/ctl select right;;
|
2006-04-12 16:14:34 +04:00
|
|
|
$MODKEY-$DOWN)
|
2006-06-19 18:05:02 +04:00
|
|
|
xwrite /tag/sel/ctl select down;;
|
2006-04-12 10:53:06 +04:00
|
|
|
$MODKEY-$UP)
|
2006-06-19 18:05:02 +04:00
|
|
|
xwrite /tag/sel/ctl select up;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-space)
|
2006-06-20 12:24:58 +04:00
|
|
|
xwrite /tag/sel/ctl select toggle;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-d)
|
2006-06-21 03:43:20 +04:00
|
|
|
xwrite /tag/sel/ctl colmode sel default;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-s)
|
2006-06-21 03:43:20 +04:00
|
|
|
xwrite /tag/sel/ctl colmode sel stack;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-m)
|
2006-06-21 03:43:20 +04:00
|
|
|
xwrite /tag/sel/ctl colmode sel max;;
|
2006-04-24 21:56:47 +04:00
|
|
|
$MODKEY-f)
|
2006-05-26 16:16:19 +04:00
|
|
|
xwrite /tag/sel/0/sel/geom 0 0 0 0;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-a)
|
2006-09-27 20:00:41 +04:00
|
|
|
`conf_which "\`proglist $ACTIONS_DIRS | $DMENU\`"` &;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-p)
|
2006-10-10 11:25:42 +04:00
|
|
|
sh -c "`$DMENU <$PROGS_FILE`" &;;
|
2006-04-11 17:32:03 +04:00
|
|
|
$MODKEY-t)
|
2006-11-04 01:00:23 +03:00
|
|
|
xwrite /ctl view "`ixpc ls /tag | sed 's,/,,; /^sel$/d' | $DMENU`" &;;
|
2006-03-06 01:38:50 +03:00
|
|
|
$MODKEY-[0-9])
|
2006-06-29 23:54:58 +04:00
|
|
|
xwrite /ctl view "`echo $1 | sed 's/.*-//'`";;
|
2006-04-11 17:32:03 +04:00
|
|
|
$MODKEY-Return)
|
2006-11-04 01:00:23 +03:00
|
|
|
xterm &;;
|
2006-04-12 17:29:03 +04:00
|
|
|
$MODKEY-Shift-$LEFT)
|
2006-06-20 02:25:49 +04:00
|
|
|
xwrite /tag/sel/ctl send sel left;;
|
2006-04-12 17:29:03 +04:00
|
|
|
$MODKEY-Shift-$RIGHT)
|
2006-06-20 02:25:49 +04:00
|
|
|
xwrite /tag/sel/ctl send sel right;;
|
2006-05-04 16:34:44 +04:00
|
|
|
$MODKEY-Shift-$DOWN)
|
2006-06-19 15:18:09 +04:00
|
|
|
xwrite /tag/sel/ctl send sel down;;
|
2006-05-04 16:34:44 +04:00
|
|
|
$MODKEY-Shift-$UP)
|
2006-06-19 15:18:09 +04:00
|
|
|
xwrite /tag/sel/ctl send sel up;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-Shift-space)
|
2006-06-19 15:18:09 +04:00
|
|
|
xwrite /tag/sel/ctl send sel toggle;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-Shift-c)
|
2006-06-20 12:24:58 +04:00
|
|
|
xwrite /client/sel/ctl kill;;
|
2006-03-24 17:00:53 +03:00
|
|
|
$MODKEY-Shift-t)
|
2006-11-04 01:00:23 +03:00
|
|
|
xwrite "/client/`ixpc read /client/sel/ctl`/tags" \
|
|
|
|
"`ixpc ls /tag | sed 's,/,,; /^sel$/d' | $DMENU`" &;;
|
2006-04-10 23:47:34 +04:00
|
|
|
$MODKEY-Shift-[0-9])
|
2006-06-30 02:03:35 +04:00
|
|
|
xwrite /client/sel/tags "`echo $1 | sed 's/.*-//'`";;
|
2006-02-25 21:36:53 +03:00
|
|
|
esac;;
|
|
|
|
esac
|
2006-05-11 03:24:21 +04:00
|
|
|
done &
|