mirror of
https://github.com/0intro/wmii
synced 2025-01-11 12:49:38 +03:00
renamed all wmi* prefixed tools into wmii* prefixed ones to prevent further confusion
This commit is contained in:
parent
1f3ecb5a7c
commit
f53b8d61ef
8
Makefile
8
Makefile
@ -5,11 +5,11 @@ include config.mk
|
||||
|
||||
SUBDIRS = libcext liblitz libixp libixp2 libwmii cmd
|
||||
|
||||
BIN = cmd/wm/wmii cmd/wm/wmiiwm cmd/wmibar cmd/wmifs \
|
||||
cmd/wmikeys cmd/wmimenu cmd/wmiplumb cmd/wmir cmd/wmiwarp
|
||||
BIN = cmd/wm/wmii cmd/wm/wmiiwm cmd/wmiibar cmd/wmiifs \
|
||||
cmd/wmiikeys cmd/wmiimenu cmd/wmiiplumb cmd/wmiir cmd/wmiiwarp
|
||||
|
||||
MAN1 = cmd/wm/wmii.1 cmd/wm/wmiiwm.1 cmd/wmibar.1 cmd/wmifs.1 \
|
||||
cmd/wmikeys.1 cmd/wmimenu.1 cmd/wmir.1
|
||||
MAN1 = cmd/wm/wmii.1 cmd/wm/wmiiwm.1 cmd/wmiibar.1 cmd/wmiifs.1 \
|
||||
cmd/wmiikeys.1 cmd/wmiimenu.1 cmd/wmiir.1
|
||||
|
||||
all:
|
||||
@echo wmii build options:
|
||||
|
44
cmd/Makefile
44
cmd/Makefile
@ -9,78 +9,78 @@ LDFLAGS += -L../liblitz -llitz -L../libixp -lixp \
|
||||
LDFLAGS2 += ${LIBS} -L../liblitz -llitz -L../libixp2 -lixp \
|
||||
-L../libwmii -lwmii -L../libcext -lcext
|
||||
|
||||
SRC_bar = wmibar.c
|
||||
SRC_bar = wmiibar.c
|
||||
OBJ_bar = ${SRC_bar:.c=.o}
|
||||
|
||||
SRC_bar2 = wmibar2.c
|
||||
SRC_bar2 = wmiibar2.c
|
||||
OBJ_bar2 = ${SRC_bar2:.c=.o}
|
||||
|
||||
SRC_menu = wmimenu.c
|
||||
SRC_menu = wmiimenu.c
|
||||
OBJ_menu = ${SRC_menu:.c=.o}
|
||||
|
||||
SRC_r2 = wmir2.c
|
||||
SRC_r2 = wmiir2.c
|
||||
OBJ_r2 = ${SRC_r2:.c=.o}
|
||||
|
||||
SRC_r = wmir.c
|
||||
SRC_r = wmiir.c
|
||||
OBJ_r = ${SRC_r:.c=.o}
|
||||
|
||||
SRC_fs = wmifs.c
|
||||
SRC_fs = wmiifs.c
|
||||
OBJ_fs = ${SRC_fs:.c=.o}
|
||||
|
||||
SRC_keys = wmikeys.c
|
||||
SRC_keys = wmiikeys.c
|
||||
OBJ_keys = ${SRC_keys:.c=.o}
|
||||
|
||||
SRC_plumb = wmiplumb.c
|
||||
SRC_plumb = wmiiplumb.c
|
||||
OBJ_plumb = ${SRC_plumb:.c=.o}
|
||||
|
||||
SRC_warp = wmiwarp.c
|
||||
SRC_warp = wmiiwarp.c
|
||||
OBJ_warp = ${SRC_warp:.c=.o}
|
||||
|
||||
all: wmibar wmibar2 wmimenu wmir wmir2 wmifs wmikeys wmiplumb wmiwarp
|
||||
@echo built wmi commands
|
||||
all: wmiibar wmiibar2 wmiimenu wmiir wmiir2 wmiifs wmiikeys wmiiplumb wmiiwarp
|
||||
@echo built wmii commands
|
||||
|
||||
.c.o:
|
||||
@echo CC $<
|
||||
@${CC} -c ${CFLAGS} $<
|
||||
|
||||
wmibar: ${OBJ_bar}
|
||||
wmiibar: ${OBJ_bar}
|
||||
@echo LD $@
|
||||
@${CC} -o $@ ${OBJ_bar} ${LDFLAGS}
|
||||
|
||||
wmibar2: ${OBJ_bar2}
|
||||
wmiibar2: ${OBJ_bar2}
|
||||
@echo LD $@
|
||||
@${CC} -o $@ ${OBJ_bar2} ${LDFLAGS2}
|
||||
|
||||
wmimenu: ${OBJ_menu}
|
||||
wmiimenu: ${OBJ_menu}
|
||||
@echo LD $@
|
||||
@${CC} -o $@ ${OBJ_menu} ${LDFLAGS}
|
||||
|
||||
wmir2: ${OBJ_r2}
|
||||
wmiir2: ${OBJ_r2}
|
||||
@echo LD $@
|
||||
@${CC} -o $@ ${OBJ_r2} -g -static -L${LIBDIR} -L/usr/lib -lc \
|
||||
-L../libixp2 -lixp -L../libcext -lcext
|
||||
|
||||
wmir: ${OBJ_r}
|
||||
wmiir: ${OBJ_r}
|
||||
@echo LD $@
|
||||
@${CC} -o $@ ${OBJ_r} -g -static -L${LIBDIR} -L/usr/lib -lc \
|
||||
-L../libixp -lixp -L../libcext -lcext
|
||||
|
||||
wmifs: ${OBJ_fs}
|
||||
wmiifs: ${OBJ_fs}
|
||||
@echo LD $@
|
||||
@${CC} -o $@ ${OBJ_fs} ${LDFLAGS}
|
||||
|
||||
wmikeys: ${OBJ_keys}
|
||||
wmiikeys: ${OBJ_keys}
|
||||
@echo LD $@
|
||||
@${CC} -o $@ ${OBJ_keys} ${LDFLAGS}
|
||||
|
||||
wmiplumb: ${OBJ_plumb}
|
||||
wmiiplumb: ${OBJ_plumb}
|
||||
@echo LD $@
|
||||
@${CC} -o $@ ${OBJ_plumb} ${LDFLAGS}
|
||||
|
||||
wmiwarp: ${OBJ_warp}
|
||||
wmiiwarp: ${OBJ_warp}
|
||||
@echo LD $@
|
||||
@${CC} -o $@ ${OBJ_warp} ${LDFLAGS}
|
||||
|
||||
clean:
|
||||
rm -f wmibar wmibar2 wmimenu wmir wmir2 wmikeys wmiplumb wmifs\
|
||||
wmiwarp *.o
|
||||
rm -f wmiibar wmiibar2 wmiimenu wmiir wmiir2 wmiikeys wmiiplumb wmiifs\
|
||||
wmiiwarp *.o
|
||||
|
18
cmd/wm/wmii
18
cmd/wm/wmii
@ -19,17 +19,17 @@ WMIR_SOCKET=/tmp/.ixp-$USER/wmifs-$WMII_IDENT
|
||||
mkdir -p /tmp/.ixp-$USER
|
||||
wmiiwm -s /tmp/.ixp-$USER/wmiiwm-$WMII_IDENT &
|
||||
wmiiwmpid=$apid
|
||||
wmifs -s /tmp/.ixp-$USER/wmifs-$WMII_IDENT &
|
||||
wmikeys -s /tmp/.ixp-$USER/wmikeys-$WMII_IDENT &
|
||||
wmibar -s /tmp/.ixp-$USER/wmibar-$WMII_IDENT &
|
||||
wmimenu -s /tmp/.ixp-$USER/wmimenu-$WMII_IDENT &
|
||||
wmiifs -s /tmp/.ixp-$USER/wmiifs-$WMII_IDENT &
|
||||
wmiikeys -s /tmp/.ixp-$USER/wmiikeys-$WMII_IDENT &
|
||||
wmiibar -s /tmp/.ixp-$USER/wmiibar-$WMII_IDENT &
|
||||
wmiimenu -s /tmp/.ixp-$USER/wmiimenu-$WMII_IDENT &
|
||||
sleep 1
|
||||
|
||||
# mount ixp file systems:
|
||||
wmir write /ctl 'bind /wm /tmp/.ixp-'^$USER/wmiiwm-$WMII_IDENT
|
||||
wmir write /ctl 'bind /bar /tmp/.ixp-'^$USER/wmibar-$WMII_IDENT
|
||||
wmir write /ctl 'bind /menu /tmp/.ixp-'^$USER/wmimenu-$WMII_IDENT
|
||||
wmir write /ctl 'bind /keys /tmp/.ixp-'^$USER/wmikeys-$WMII_IDENT
|
||||
wmiir write /ctl 'bind /wm /tmp/.ixp-'^$USER/wmiiwm-$WMII_IDENT
|
||||
wmiir write /ctl 'bind /bar /tmp/.ixp-'^$USER/wmiibar-$WMII_IDENT
|
||||
wmiir write /ctl 'bind /menu /tmp/.ixp-'^$USER/wmiimenu-$WMII_IDENT
|
||||
wmiir write /ctl 'bind /keys /tmp/.ixp-'^$USER/wmiikeys-$WMII_IDENT
|
||||
|
||||
# display the wmii introduction if necessary:
|
||||
if(mkdir $HOME/.wmii-3 >[2]/dev/null) {
|
||||
@ -37,7 +37,7 @@ if(mkdir $HOME/.wmii-3 >[2]/dev/null) {
|
||||
}
|
||||
|
||||
# run configuration:
|
||||
wmirc &
|
||||
wmiirc &
|
||||
|
||||
# wait for wmiiwm's termination:
|
||||
wait $wmiiwmpid
|
||||
|
10
rc/kmode
10
rc/kmode
@ -1,11 +1,11 @@
|
||||
#!9PREFIX/bin/rc
|
||||
# activate shortcuts of the given mode
|
||||
|
||||
wmir write /keys/grabkeyb 0
|
||||
wmir write /keys/lookup /mode/$1
|
||||
wmiir write /keys/grabkeyb 0
|
||||
wmiir write /keys/lookup /mode/$1
|
||||
|
||||
plab_cmd=`{wmir read /wm/event/pageupdate | sed -e 's/\\//'}
|
||||
plab_cmd=`{wmiir read /wm/event/pageupdate | sed -e 's/\\//'}
|
||||
if (! ~ $#plab_cmd 0) eval $"plab_cmd
|
||||
|
||||
#wmir write /bar/$plab/data \
|
||||
#`{wmir read /bar/$plab/data | sed -e 's/.$/'^`{echo $2 | cut -b1}^'/'}
|
||||
#wmiir write /bar/$plab/data \
|
||||
#`{wmiir read /bar/$plab/data | sed -e 's/.$/'^`{echo $2 | cut -b1}^'/'}
|
||||
|
2
rc/quit
2
rc/quit
@ -1,4 +1,4 @@
|
||||
#!9PREFIX/bin/rc
|
||||
# quit wmii
|
||||
|
||||
wmir write /wm/ctl quit
|
||||
wmiir write /wm/ctl quit
|
||||
|
14
rc/status
14
rc/status
@ -8,22 +8,22 @@ if(test -r $PIDFILE) {
|
||||
}
|
||||
echo $pid >$PIDFILE
|
||||
|
||||
label=`{wmir read /bar/new}
|
||||
wmir write /bar/$label/b1press 'wmir write /wm/ctl ''select prev'''
|
||||
wmir write /bar/$label/b3press 'wmir write /wm/ctl ''select next'''
|
||||
wmir write /bar/$label/b4press 'wmir write /wm/ctl ''select prev'''
|
||||
wmir write /bar/$label/b5press 'wmir write /wm/ctl ''select next'''
|
||||
label=`{wmiir read /bar/new}
|
||||
wmiir write /bar/$label/b1press 'wmiir write /wm/ctl ''select prev'''
|
||||
wmiir write /bar/$label/b3press 'wmiir write /wm/ctl ''select next'''
|
||||
wmiir write /bar/$label/b4press 'wmiir write /wm/ctl ''select prev'''
|
||||
wmiir write /bar/$label/b5press 'wmiir write /wm/ctl ''select next'''
|
||||
|
||||
# install signal handler for artificial sigexit:
|
||||
fn sigint {
|
||||
if(test -f $PIDFILE && ~ `{cat $PIDFILE} $pid)
|
||||
rm -f $PIDFILE
|
||||
wmir write /bar/ctl 'destroy '^$label
|
||||
wmiir write /bar/ctl 'destroy '^$label
|
||||
exit
|
||||
}
|
||||
|
||||
text=fnord
|
||||
while(wmir write /bar/$label/data $"text >[2]/dev/null) {
|
||||
while(wmiir write /bar/$label/data $"text >[2]/dev/null) {
|
||||
# if you need formatted date, use /bin/date instead
|
||||
text=(`{date} `{uptime | sed 's/.*://; s/,//g'})
|
||||
sleep 10
|
||||
|
@ -49,13 +49,13 @@ Let's go!
|
||||
window somewhere to the left. Afterwards, swap them once again, but this
|
||||
time by pressing M-return.
|
||||
- We'll now have a look at the internal filesystem used by wmii. Executing
|
||||
wmir read /
|
||||
wmiir read /
|
||||
in the shell of the terminal will list all the files in the root directory.
|
||||
Files ending with a slash are directories. As you can see, / contains a
|
||||
"normal" file and four directories. These directories correspond to the
|
||||
four main components of wmii: wmiiwm, wmibar, wmikeys, and wmimenu. If you
|
||||
are curious, you can now dig deeper into the directory trees. For instance,
|
||||
wmir read /bar/1/b1press
|
||||
wmiir read /bar/1/b1press
|
||||
will show you which command gets executed when you left-click on the page
|
||||
label in the bar.
|
||||
|
||||
|
170
rc/wmiirc
Normal file
170
rc/wmiirc
Normal file
@ -0,0 +1,170 @@
|
||||
#!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 urxvt ''+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/sel/geometry 0,0,east,south-20; wmiir write /wm/sel/layout/sel/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/ctl ''select prev'''
|
||||
kbind normal $MODKEY-$EASTKEY 'wmiir write /wm/ctl ''select next'''
|
||||
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/sel/layout/sel/ctl ''select west'''
|
||||
kbind normal $MODKEY-S-$EASTKEY 'wmiir write /wm/sel/layout/sel/ctl ''select east'''
|
||||
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&
|
170
rc/wmirc
170
rc/wmirc
@ -1,170 +0,0 @@
|
||||
#!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 {
|
||||
wmir create /keys/mode/$1/$2 $3
|
||||
}
|
||||
|
||||
fn selstyle {
|
||||
wmir write $1/fgcolor $SEL_FG_COLOR
|
||||
wmir write $1/bgcolor $SEL_BG_COLOR
|
||||
wmir write $1/bordercolor $SEL_BORDER_COLOR
|
||||
}
|
||||
|
||||
fn normstyle {
|
||||
wmir write $1/fgcolor $NORM_FG_COLOR
|
||||
wmir write $1/bgcolor $NORM_BG_COLOR
|
||||
wmir 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 | wmir -f &
|
||||
}
|
||||
|
||||
fn frameconf {
|
||||
wmir write $1/event/b2press 'wmir write /wm/ctl close'
|
||||
normstyle $1/nstyle
|
||||
selstyle $1/sstyle
|
||||
wmir write $1/tab $TAB
|
||||
if(~ $2 refresh)
|
||||
wmir write $1/geometry +0,+0,+0,+0 # causes refresh
|
||||
}
|
||||
|
||||
fn framesconf {
|
||||
for(frame in `{wmir read $1 | grep '^[0-9]'})
|
||||
frameconf $1/$frame $2
|
||||
}
|
||||
|
||||
|
||||
# WMIBAR CONFIGURATION
|
||||
|
||||
fn barsucks {
|
||||
wmir write /bar/$1/b1press 'wmir write /wm/ctl ''select prev'''
|
||||
wmir write /bar/$1/b3press 'wmir write /wm/ctl ''select next'''
|
||||
wmir write /bar/$1/b4press 'wmir write /wm/ctl ''select prev'''
|
||||
wmir write /bar/$1/b5press 'wmir write /wm/ctl ''select next'''
|
||||
}
|
||||
|
||||
wmir write /bar/ctl reset
|
||||
wmir write /bar/font $FONT
|
||||
wmir write /bar/fgcolor $NORM_FG_COLOR
|
||||
wmir write /bar/bgcolor $NORM_BG_COLOR
|
||||
wmir write /bar/bordercolor $NORM_BORDER_COLOR
|
||||
|
||||
plab=`{wmir read /bar/new}
|
||||
wmir write /bar/$plab/b1press 'wmir write /wm/ctl pager'
|
||||
|
||||
llab=`{wmir read /bar/new}
|
||||
wmir write /bar/$llab/b1press 'wmir write /wm/ctl pager'
|
||||
|
||||
clab=`{wmir read /bar/new}
|
||||
wmir write /bar/$clab/fgcolor $SEL_FG_COLOR
|
||||
wmir write /bar/$clab/bgcolor $SEL_BG_COLOR
|
||||
wmir write /bar/$clab/bordercolor $SEL_BG_COLOR
|
||||
barsucks $clab
|
||||
|
||||
wmir write /bar/expandable $clab
|
||||
wmir write /bar/ctl 'display 1'
|
||||
|
||||
|
||||
# WMIIWM CONFIGURATION
|
||||
|
||||
wmir write /wm/default/font $FONT
|
||||
wmir write /wm/default/transcolor $SEL_BORDER_COLOR
|
||||
wmir write /wm/default/handleinc 0
|
||||
|
||||
wmir write /wm/default/border 1
|
||||
wmir write /wm/event/clientupdate \
|
||||
'text=`{wmir read /wm/sel/layout/sel/frame/sel/client/sel/name} \
|
||||
wmir write /bar/'^$clab^'/data $"text'
|
||||
wmir write /wm/event/pageupdate \
|
||||
'wmir write /bar/'^$plab^'/data `{wmir read /wm/sel/name} &&' ^ \
|
||||
'wmir write /bar/'^$llab^'/data `{wmir read /wm/sel/layout/sel/name}'
|
||||
|
||||
for(frame in `{wmir 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 'wmir write /menu/precmd ''''; wmir write /menu/lookup /items/actions; wmir write /menu/ctl ''display 1'''
|
||||
kbind normal $MODKEY-C-p 'wmir write /menu/precmd extern; wmir write /menu/lookup /items/programs; wmir write /menu/ctl ''display 1'''
|
||||
kbind normal $MODKEY-C-c 'wmir write /wm/ctl close'
|
||||
kbind normal $MODKEY-C-q,y quit
|
||||
kbind normal $MODKEY-C-w,y wmirc
|
||||
kbind normal $MODKEY-t 'extern urxvt ''+sb'' -bg ''#000000'' -fg ''#ffffff'' -cr ''#ffffff'' -sl 4000 -fn -artwiz-smoothansi-*-*-*-*-*-*-*-*-*-*-*-*'
|
||||
kbind normal $MODKEY-d 'wmir write /wm/ctl detach'
|
||||
kbind normal $MODKEY-a 'wmir write /wm/ctl attach'
|
||||
kbind normal $MODKEY-S-a 'wmir write /wm/ctl ''detached clients'''
|
||||
kbind normal $MODKEY-S-c 'wmir write /wm/sel/layout/sel/geometry 0,0,east,south-20; wmir write /wm/sel/layout/sel/name column'
|
||||
kbind normal $MODKEY-S-n 'wmir write /wm/sel/layout/sel/ctl new'
|
||||
kbind normal $MODKEY-S-d 'wmir write /wm/sel/layout/sel/ctl destroy'
|
||||
kbind normal $MODKEY-S-f 'wmir write /wm/sel/layout/sel/name float'
|
||||
kbind normal $MODKEY-Return 'wmir write /wm/sel/ctl ''select zoomed'''
|
||||
kbind normal $MODKEY-C-y 'wmir write /wm/ctl new'
|
||||
kbind normal $MODKEY-u 'wmir write /wm/sel/layout/sel/frame/sel/locked 0'
|
||||
kbind normal $MODKEY-S-u 'wmir write /wm/sel/layout/sel/frame/sel/locked 1'
|
||||
kbind normal $MODKEY-$WESTKEY 'wmir write /wm/ctl ''select prev'''
|
||||
kbind normal $MODKEY-$EASTKEY 'wmir write /wm/ctl ''select next'''
|
||||
kbind normal $MODKEY-Tab 'wmir write /wm/sel/layout/sel/ctl ''select next'''
|
||||
kbind normal $MODKEY-$SOUTHKEY 'wmir write /wm/sel/layout/sel/ctl ''select next'''
|
||||
kbind normal $MODKEY-$NORTHKEY 'wmir write /wm/sel/layout/sel/ctl ''select prev'''
|
||||
kbind normal $MODKEY-S-$WESTKEY 'wmir write /wm/sel/layout/sel/ctl ''select west'''
|
||||
kbind normal $MODKEY-S-$EASTKEY 'wmir write /wm/sel/layout/sel/ctl ''select east'''
|
||||
kbind normal $MODKEY-S-Tab 'wmir write /wm/sel/layout/sel/frame/sel/ctl ''select next'''
|
||||
kbind normal $MODKEY-S-$SOUTHKEY 'wmir write /wm/sel/layout/sel/frame/sel/ctl ''select next'''
|
||||
kbind normal $MODKEY-S-$NORTHKEY 'wmir write /wm/sel/layout/sel/frame/sel/ctl ''select prev'''
|
||||
kbind normal $MODKEY-space 'wmir write /wm/sel/ctl ''select toggled'''
|
||||
kbind normal $MODKEY-S-p 'wmir write /wm/ctl pager'
|
||||
for(i in 0 1 2 3 4 5 6 7 8 9) {
|
||||
kbind normal $MODKEY-S-$i 'wmir write /wm/ctl ''select '^$i^''''
|
||||
}
|
||||
|
||||
wmir write /keys/box/font $FONT
|
||||
selstyle /keys/box
|
||||
kmode normal
|
||||
|
||||
# WMIMENU CONFIGURATION
|
||||
items actions $WMII_CONFDIR:$HOME/.wmii-3
|
||||
wmir create /menu/items/actions/rmpage 'wmir write /wm/ctl destroy'
|
||||
items programs $OLD_PATH
|
||||
wmir write /menu/font $FONT
|
||||
normstyle /menu/nstyle >[2]/dev/null
|
||||
selstyle /menu/sstyle >[2]/dev/null
|
||||
|
||||
# MISC
|
||||
xsetroot -solid black
|
||||
status&
|
Loading…
Reference in New Issue
Block a user