mirror of
https://github.com/0intro/wmii
synced 2025-02-04 00:14:27 +03:00
109 lines
2.2 KiB
Bash
Executable File
109 lines
2.2 KiB
Bash
Executable File
#!9PREFIX/bin/rc -x
|
|
# configure wmii
|
|
|
|
CLIENT_BAR=0
|
|
CLIENT_BORDER=3
|
|
HANDLEINC=1
|
|
|
|
fn xwrite { echo -n $2 | wmiir write $1 }
|
|
|
|
# WMIIWM CONFIGURATION
|
|
xwrite /wm/default/bar $CLIENT_BAR
|
|
xwrite /wm/default/border $CLIENT_BORDER
|
|
xwrite /wm/default/font $FONT
|
|
xwrite /wm/default/selcolor $SEL_COLOR
|
|
xwrite /wm/default/normcolor $NORM_COLOR
|
|
for(page in `{wmiir read /wm | grep '^d' | awk '{print $10}' | grep -v new}) {
|
|
for(area in `{wmiir read /wm/$page | grep '^d' | awk '{print $10}' | grep -v new}) {
|
|
for(client in `{wmiir read /wm/$page/$area | grep '^d' | awk '{print $10}'}) {
|
|
xwrite /wm/$page/$area/$client/bar $CLIENT_BAR
|
|
xwrite /wm/$page/$area/$client/border $CLIENT_BORDER
|
|
}
|
|
}
|
|
}
|
|
|
|
# WMIIBAR CONFIGURATION
|
|
xwrite /bar/font $FONT
|
|
xwrite /bar/defcolor $SEL_COLOR
|
|
echo -n fnord | wmiir write /bar/new/data
|
|
echo -n key | wmiir write /bar/new/data
|
|
|
|
# MISC
|
|
xsetroot -mod 2 2 -bg '#444466' -fg '#555555'
|
|
status&
|
|
|
|
wmiir write /wm/keys/grab <<END
|
|
Control-Alt-k
|
|
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 /wm/event | \
|
|
while(key=`{read}) {
|
|
xwrite /bar/2/data $key
|
|
switch($key) {
|
|
case Control-Alt-c
|
|
xwrite /wm/sel/sel/sel/ctl kill
|
|
case Control-Alt-q,y
|
|
quit
|
|
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'}
|
|
}
|
|
}
|