wmii/rc/wmiirc
2005-12-12 18:04:40 +02:00

172 lines
5.7 KiB
Bash

#!9PREFIX/bin/rc
# configure wmii
TAB=0
SEL_BG_COLOR='#002200'
SEL_FG_COLOR='#66ff00'
SEL_BORDER_COLOR='#66ff00'
NORM_BG_COLOR='#000000'
NORM_FG_COLOR='#eeeeee'
NORM_BORDER_COLOR='#111111'
FONT='-artwiz-snap-normal-*-*-*-*-*-*-*-*-*-*-*'
MODKEY=M
NORTHKEY=k
SOUTHKEY=j
WESTKEY=h
EASTKEY=l
nl='
'
fn kbind {
wmiir create /keys/mode/$1/$2 $3
}
fn selstyle {
wmiir write $1/fgcolor $SEL_FG_COLOR
wmiir write $1/bgcolor $SEL_BG_COLOR
wmiir write $1/bordercolor $SEL_BORDER_COLOR
}
fn normstyle {
wmiir write $1/fgcolor $NORM_FG_COLOR
wmiir write $1/bgcolor $NORM_BG_COLOR
wmiir write $1/bordercolor $NORM_BORDER_COLOR
}
fn items {
ifs=:$nl { dirs=`{echo $2} }
{
for(dir in $dirs) {
for(file in $dir/*) {
if(! ~ $file $dir^'/*' && ! test -d $file && test -x $file) {
file=`{basename $file}
echo create /menu/items/$1/$"file $"file
}
}
}
} | sort | wmiir -f &
}
fn frameconf {
wmiir write $1/event/b2press 'wmiir write /wm/ctl close'
normstyle $1/nstyle
selstyle $1/sstyle
wmiir write $1/tab $TAB
if(~ $2 refresh)
wmiir write $1/geometry +0,+0,+0,+0 # causes refresh
}
fn framesconf {
for(frame in `{wmiir read $1 | grep '^[0-9]'})
frameconf $1/$frame $2
}
# WMIBAR CONFIGURATION
fn barsucks {
wmiir write /bar/$1/b1press 'wmiir write /wm/ctl ''select prev'''
wmiir write /bar/$1/b3press 'wmiir write /wm/ctl ''select next'''
wmiir write /bar/$1/b4press 'wmiir write /wm/ctl ''select prev'''
wmiir write /bar/$1/b5press 'wmiir write /wm/ctl ''select next'''
}
wmiir write /bar/ctl reset
wmiir write /bar/font $FONT
wmiir write /bar/fgcolor $NORM_FG_COLOR
wmiir write /bar/bgcolor $NORM_BG_COLOR
wmiir write /bar/bordercolor $NORM_BORDER_COLOR
plab=`{wmiir read /bar/new}
wmiir write /bar/$plab/b1press 'wmiir write /wm/ctl pager'
llab=`{wmiir read /bar/new}
wmiir write /bar/$llab/b1press 'wmiir write /wm/ctl pager'
clab=`{wmiir read /bar/new}
wmiir write /bar/$clab/fgcolor $SEL_FG_COLOR
wmiir write /bar/$clab/bgcolor $SEL_BG_COLOR
wmiir write /bar/$clab/bordercolor $SEL_BG_COLOR
barsucks $clab
wmiir write /bar/expandable $clab
wmiir write /bar/ctl 'display 1'
# WMIIWM CONFIGURATION
wmiir write /wm/default/font $FONT
wmiir write /wm/default/transcolor $SEL_BORDER_COLOR
wmiir write /wm/default/handleinc 0
wmiir write /wm/default/border 1
wmiir write /wm/event/clientupdate \
'text=`{wmiir read /wm/sel/layout/sel/frame/sel/client/sel/name} \
wmiir write /bar/'^$clab^'/data $"text'
wmiir write /wm/event/pageupdate \
'wmiir write /bar/'^$plab^'/data `{wmiir read /wm/sel/name} &&' ^ \
'wmiir write /bar/'^$llab^'/data `{wmiir read /wm/sel/layout/sel/name}'
for(frame in `{wmiir read /wm/sel/layout/sel | grep '^[0-9]'})
framesconf /wm/sel/layout/sel/$frame refresh
frameconf /wm/default norefresh
# WMIKEYS CONFIGURATION
kbind bare $MODKEY-Escape 'kmode normal'
kbind normal $MODKEY-C-b 'kmode bare'
kbind normal $MODKEY-C-a 'wmiir write /menu/precmd ''''; wmiir write /menu/lookup /items/actions; wmiir write /menu/ctl ''display 1'''
kbind normal $MODKEY-C-p 'wmiir write /menu/precmd extern; wmiir write /menu/lookup /items/programs; wmiir write /menu/ctl ''display 1'''
kbind normal $MODKEY-C-c 'wmiir write /wm/ctl close'
kbind normal $MODKEY-C-q,y quit
kbind normal $MODKEY-C-w,y wmiirc
kbind normal $MODKEY-t 'extern xterm ''+sb'' -bg ''#000000'' -fg ''#ffffff'' -cr ''#ffffff'' -sl 4000 -fn -artwiz-smoothansi-*-*-*-*-*-*-*-*-*-*-*-*'
kbind normal $MODKEY-d 'wmiir write /wm/ctl detach'
kbind normal $MODKEY-a 'wmiir write /wm/ctl attach'
kbind normal $MODKEY-S-a 'wmiir write /wm/ctl ''detached clients'''
kbind normal $MODKEY-S-c 'wmiir write /wm/sel/layout/1/geometry 0,0,east,south-20; wmiir write /wm/sel/layout/1/name column'
kbind normal $MODKEY-S-n 'wmiir write /wm/sel/layout/sel/ctl new'
kbind normal $MODKEY-S-d 'wmiir write /wm/sel/layout/sel/ctl destroy'
kbind normal $MODKEY-S-f 'wmiir write /wm/sel/layout/sel/name float'
kbind normal $MODKEY-Return 'wmiir write /wm/sel/ctl ''select zoomed'''
kbind normal $MODKEY-C-y 'wmiir write /wm/ctl new'
kbind normal $MODKEY-u 'wmiir write /wm/sel/layout/sel/frame/sel/locked 0'
kbind normal $MODKEY-S-u 'wmiir write /wm/sel/layout/sel/frame/sel/locked 1'
kbind normal $MODKEY-$WESTKEY 'wmiir write /wm/sel/layout/sel/ctl ''select west'''
kbind normal $MODKEY-$EASTKEY 'wmiir write /wm/sel/layout/sel/ctl ''select east'''
kbind normal $MODKEY-Tab 'wmiir write /wm/sel/layout/sel/ctl ''select next'''
kbind normal $MODKEY-$SOUTHKEY 'wmiir write /wm/sel/layout/sel/ctl ''select next'''
kbind normal $MODKEY-$NORTHKEY 'wmiir write /wm/sel/layout/sel/ctl ''select prev'''
kbind normal $MODKEY-S-$WESTKEY 'wmiir write /wm/ctl ''select prev'''
kbind normal $MODKEY-S-$EASTKEY 'wmiir write /wm/ctl ''select next'''
kbind normal $MODKEY-Space 'wmiir write /wm/sel/ctl ''select next'''
kbind normal $MODKEY-S-Tab 'wmiir write /wm/sel/layout/sel/frame/sel/ctl ''select next'''
kbind normal $MODKEY-S-$SOUTHKEY 'wmiir write /wm/sel/layout/sel/frame/sel/ctl ''select next'''
kbind normal $MODKEY-S-$NORTHKEY 'wmiir write /wm/sel/layout/sel/frame/sel/ctl ''select prev'''
kbind normal $MODKEY-space 'wmiir write /wm/sel/ctl ''select toggled'''
kbind normal $MODKEY-S-p 'wmiir write /wm/ctl pager'
for(i in 0 1 2 3 4 5 6 7 8 9) {
kbind normal $MODKEY-S-$i 'wmiir write /wm/ctl ''select '^$i^''''
}
wmiir write /keys/box/font $FONT
selstyle /keys/box
kmode normal
# WMIMENU CONFIGURATION
items actions $WMII_CONFDIR:$HOME/.wmii-3
wmiir create /menu/items/actions/rmpage 'wmiir write /wm/ctl destroy'
items programs $OLD_PATH
wmiir write /menu/font $FONT
normstyle /menu/nstyle >[2]/dev/null
selstyle /menu/sstyle >[2]/dev/null
# MISC
xsetroot -solid black
status&