mirror of
https://github.com/0intro/wmii
synced 2025-02-20 00:04:37 +03:00
100 lines
1.8 KiB
Bash
Executable File
100 lines
1.8 KiB
Bash
Executable File
#!9PREFIX/bin/rc
|
|
# configure wmiikeys
|
|
|
|
ADDRESS=unix!/tmp/.ixp-$USER/wmiikeys-$WMII_IDENT
|
|
PIDFILE=/tmp/.ixp-$USER/keyspid-$WMII_IDENT
|
|
if(test -r $PIDFILE) {
|
|
kill -2 `{cat $PIDFILE} >[2]/dev/null
|
|
}
|
|
echo $pid >$PIDFILE
|
|
|
|
fn xwrite { echo -n $2 | wmiir write $1 }
|
|
|
|
fn sigint {
|
|
if(test -f $PIDFILE && ~ `{cat $PIDFILE} $pid)
|
|
rm -f $PIDFILE
|
|
xwrite /keys/ctl quit
|
|
xwrite /ctl 'unmount /keys'
|
|
exit
|
|
}
|
|
|
|
wmiikeys -a $ADDRESS &
|
|
xwrite /ctl 'mount '^$ADDRESS^' /keys'
|
|
sleep 1
|
|
|
|
wmiir write /keys/grab <<END
|
|
Control-Alt-c
|
|
Control-Alt-q,y
|
|
Control-Alt-w,y
|
|
Alt-t
|
|
Alt-d
|
|
Alt-a
|
|
Shift-Alt-a
|
|
Alt-n
|
|
Alt-m
|
|
Alt-Return
|
|
Shift-Alt-Return
|
|
Control-Alt-y
|
|
Alt-h
|
|
Alt-l
|
|
Alt-Tab
|
|
Alt-j
|
|
Alt-k
|
|
Shift-Alt-h
|
|
Shift-Alt-l
|
|
Shift-Alt-p
|
|
Shift-Alt-1
|
|
Shift-Alt-2
|
|
Shift-Alt-3
|
|
Shift-Alt-4
|
|
END
|
|
|
|
wmiir read /keys/event | while(key=`{read}) {
|
|
switch($key) {
|
|
case Control-Alt-c
|
|
xwrite /wm/sel/sel/sel/ctl kill
|
|
case Control-Alt-q,y
|
|
quit
|
|
case Control-Alt-w,y
|
|
wmiirc
|
|
case Alt-t
|
|
extern xterm -rv &
|
|
case Alt-d
|
|
xwrite /wm/sel/sel/sel/ctl detach
|
|
case Alt-a
|
|
xwrite /wm/ctl attach
|
|
case Shift-Alt-a
|
|
xwrite /wm/ctl detached
|
|
case Alt-n
|
|
wmiir read /wm/sel/new >/dev/null >[2=1]
|
|
case Alt-m
|
|
xwrite /wm/sel/sel/sel/ctl max
|
|
case Alt-Return
|
|
xwrite /wm/sel/sel/ctl 'swap east'
|
|
case Shift-Alt-Return
|
|
xwrite /wm/sel/sel/ctl 'swap west'
|
|
case Control-Alt-y
|
|
wmiir read /wm/new >/dev/null >[2=1]
|
|
case Alt-h
|
|
xwrite /wm/sel/ctl 'select next'
|
|
case Alt-l
|
|
xwrite /wm/sel/ctl 'select prev'
|
|
case Alt-Tab
|
|
xwrite /wm/sel/sel/ctl 'select next'
|
|
case Alt-j
|
|
xwrite /wm/sel/sel/ctl 'select next'
|
|
case Alt-k
|
|
xwrite /wm/sel/sel/ctl 'select prev'
|
|
case Shift-Alt-h
|
|
xwrite /wm/ctl 'select prev'
|
|
case Shift-Alt-l
|
|
xwrite /wm/ctl 'select next'
|
|
case Shift-Alt-p
|
|
xwrite /wm/ctl pager
|
|
case Shift-Alt-[1-9]
|
|
xwrite /wm/ctl 'select '^`{echo $k|sed 's/.*-//g'}
|
|
}
|
|
}
|
|
|
|
sigint
|