Deprecate '# Overrides'

This commit is contained in:
Kris Maglione 2007-06-26 22:39:03 -04:00
parent 7a91559743
commit 511731482b
4 changed files with 86 additions and 73 deletions

View File

@ -1,5 +1,5 @@
'\" t '\" t
.\" Manual page created with latex2man on Mon Jun 11 15:48:33 EDT 2007 .\" Manual page created with latex2man on Tue Jun 26 20:44:34 EDT 2007
.\" NOTE: This file is generated, DO NOT EDIT. .\" NOTE: This file is generated, DO NOT EDIT.
.de Vb .de Vb
.ft CW .ft CW
@ -10,7 +10,7 @@
.fi .fi
.. ..
.TH "WMII" "1" "11 June 2007" "" "" .TH "WMII" "1" "26 June 2007" "" ""
.SH NAME .SH NAME
wmii\-VERSION wmii\-VERSION
.PP .PP
@ -436,16 +436,15 @@ Rules are specified:
\fB \fP \fB \fP
.br .br
When a client\&'s \fIname\fP:\fIclass\fP:\fItitle\fP When a client\&'s \fIname\fP:\fIclass\fP:\fItitle\fP
matches \fIregex\fP, matches
it is given the tagstring \fIregex\fP,
\fItag\fP\&. it is given the tagstring \fItag\fP\&.
There are two special tags. \fI!\fP, There are
which two special tags. \fI!\fP,
will be replaced with \fIsel\fP which is deprecated, and identical
in the future, to \fIsel\fP,
represents the current tag. \fI^\fP represents the current tag. \fI^\fP
represents the represents the floating layer.
floating layer.
.TP .TP
keys keys
The \fIkeys\fP The \fIkeys\fP

View File

@ -202,7 +202,7 @@ follows.
\begin{description} \begin{description}
\item[colrules] The \emph{colrules} file contains a list of \item[colrules] The \emph{colrules} file contains a list of
rules which affect the width of newly created columns. rules which affect the width of newly created columns.
Rules have the form: \\ \SP % Yuck! Rules have the form: \\ \SP % Yuck! (kludge)
\MANbr \MANbr
\SP\SP /\Arg{regex}/ -> \Arg{width}\oArg{+width...} \\ \SP \SP\SP /\Arg{regex}/ -> \Arg{width}\oArg{+width...} \\ \SP
\MANbr \MANbr
@ -218,12 +218,11 @@ follows.
\MANbr \MANbr
\SP\SP /\Arg{regex}/ -> \Arg{tag}\oArg{+tag...} \\ \SP \SP\SP /\Arg{regex}/ -> \Arg{tag}\oArg{+tag...} \\ \SP
\MANbr \MANbr
When a client's \Arg{name}:\Arg{class}:\Arg{title} When a client's \Arg{name}:\Arg{class}:\Arg{title} matches
matches \Arg{regex}, it is given the tagstring \Arg{regex}, it is given the tagstring \Arg{tag}. There are
\Arg{tag}. There are two special tags. \emph{!}, which two special tags. \emph{!}, which is deprecated, and identical
will be replaced with \emph{sel} in the future, to \emph{sel}, represents the current tag. \emph{\Circum}
represents the current tag. \emph{\Circum} represents the represents the floating layer.
floating layer.
\item[keys] The \emph{keys} file contains a list of keys which \item[keys] The \emph{keys} file contains a list of keys which
\Prog{wmii} will grab. Whenever these key combinations \Prog{wmii} will grab. Whenever these key combinations
are pressed, the string which represents them are are pressed, the string which represents them are

View File

@ -31,8 +31,10 @@ fn 9menu {
fn config_whatis { fn config_whatis {
confpath=`{echo $WMII_CONFPATH | sed 'y/:/ /'} confpath=`{echo $WMII_CONFPATH | sed 'y/:/ /'}
prog=$1; shift prog = `{{path=$confpath whatis $1} | grep -v '^fn|= '}; shift
echo `{{path=$confpath whatis $prog} | grep -v '=|^fn '} $* if(~ $#prog 0)
prog = /dev/null
echo $prog $*
} }
if(echo $0 | grep -vs '/rc.wmii$') { if(echo $0 | grep -vs '/rc.wmii$') {
@ -52,10 +54,6 @@ rc.wmii can't run:
wmiirc will be run instead. wmiirc will be run instead.
! !
# Source Variables, &c
local = `{config_whatis rc.wmii.local}
. <{awk '//; /^# Overrides/ { exit }' $local </dev/null}
# Column Rules # Column Rules
wmiir write /colrules <<! wmiir write /colrules <<!
/./ -> 60+40 /./ -> 60+40
@ -65,7 +63,7 @@ wmiir write /colrules <<!
wmiir write /tagrules <<! wmiir write /tagrules <<!
/XMMS.*/ -> ~ /XMMS.*/ -> ~
/MPlayer.*/ -> ~ /MPlayer.*/ -> ~
/.*/ -> ! /.*/ -> sel
/.*/ -> 1 /.*/ -> 1
! !
@ -74,18 +72,37 @@ fn status {
echo -n `{uptime | sed 's/.*://; s/,//g'} '|' `{date} echo -n `{uptime | sed 's/.*://; s/,//g'} '|' `{date}
} }
# Functions
fn viewtitle { echo $* } fn viewtitle { echo $* }
# Events fn proglist {
fn Event-Start { /bin/ls -lL `{echo $* | sed 'y/:/ /'} >[2]/dev/null \
switch($1) { | awk '$1 ~ /^[^d].*x/ { print $NF }' \
case wmiirc | sort | uniq
rm -f $progs_file
exit
}
} }
fn Event-Key { eval Key-$1 $1 } fn getfuns {
env | sed -n 's/^fn#'^$1^'-([^=]+).*/\1/p'
}
fn actionlist {
{ proglist $WMII_CONFPATH
getfuns Action
} | sort | uniq
}
fn initkeys {
getfuns Key | wmiir write /keys
}
fn read_tags {
wmiir ls /tag | sed 's,/,,; /^sel$/d'
}
fn run_command {
rfork ns
path=$oldpath { eval exec $* }
}
fn Event-CreateTag { echo $WMII_NORMCOLORS `{viewtitle $*} | wmiir create /lbar/$"* } fn Event-CreateTag { echo $WMII_NORMCOLORS `{viewtitle $*} | wmiir create /lbar/$"* }
fn Event-DestroyTag { wmiir remove /lbar/$"* } fn Event-DestroyTag { wmiir remove /lbar/$"* }
@ -112,14 +129,16 @@ fn Event-ClientMouseDown {
} }
} }
fn 'fn?' {rc -c 'whatis '$1 >[2]/dev/null | grep -s '^fn ' }
# Actions # Actions
fn Action { fn Action {
action=$1; shift cmd=$1 action=Action-$cmd { shift
if(whatis Action-$action | grep -s '^fn ') { if('fn?' $action)
Action-$action $* & $action $*
};if not { if not
run_command `{config_whatis $action} $* & run_command `{config_whatis $cmd} $*
} } &
} }
fn Action-rehash { proglist $PATH >$progs_file } fn Action-rehash { proglist $PATH >$progs_file }
fn Action-quit { wmiir xwrite /ctl quit } fn Action-quit { wmiir xwrite /ctl quit }
@ -133,6 +152,30 @@ fn Action-status {
sleep 1 sleep 1
} }
# Events
fn Event-Start {
switch($1) {
case wmiirc
rm -f $progs_file
exit
}
}
fn Event-Key { eval Key-$1 $1 }
# Source Variables, &c
local = `{config_whatis rc.wmii.local}
. <{awk '//;
/^# Overrides/ {
print "xmessage -file - <<!"
print "rc.wmii: Warning:"
print " Your rc.wmii.local contains an ''# Overrides'' line."
print " This line has a deprecated special meaning. Functions"
print " you wish to override should be defined in a function"
print " called Action-overridekeys"
print "!"
exit
}' $local </dev/null}
# Key Bindings # Key Bindings
fn Key-$MODKEY-Control-t { fn Key-$MODKEY-Control-t {
switch(`{wmiir read /keys | wc -l}) { switch(`{wmiir read /keys | wc -l}) {
@ -175,38 +218,6 @@ fn Key-$MODKEY-Shift-t {
fn Key-$MODKEY-^`{seq 0 9} { wmiir xwrite /ctl view `{echo $1 | sed 's/.*-//'} } fn Key-$MODKEY-^`{seq 0 9} { wmiir xwrite /ctl view `{echo $1 | sed 's/.*-//'} }
fn Key-Shift-$MODKEY-^`{seq 0 9} { wmiir xwrite /client/sel/tags `{echo $1 | sed 's/.*-//'} } fn Key-Shift-$MODKEY-^`{seq 0 9} { wmiir xwrite /client/sel/tags `{echo $1 | sed 's/.*-//'} }
# Functions
fn proglist {
/bin/ls -lL `{echo $* | sed 'y/:/ /'} >[2]/dev/null \
| awk '$1 ~ /^[^d].*x/ { print $NF }' \
| sort | uniq
}
fn getfuns {
env | sed -n 's/^fn#'^$1^'-([^=]+).*/\1/p'
}
fn actionlist {
{ proglist $WMII_CONFPATH
getfuns Action
} | sort | uniq
}
fn initkeys {
getfuns Key | wmiir write /keys
}
fn read_tags {
wmiir ls /tag | sed 's,/,,; /^sel$/d'
}
fn run_command {
@{ rfork ns
path=$oldpath
eval exec $*
}
}
# WM Configuration # WM Configuration
wmiir write /ctl <<! wmiir write /ctl <<!
grabmod $MODKEY grabmod $MODKEY
@ -219,9 +230,13 @@ xsetroot -solid $WMII_BACKGROUND
# Source Overrides # Source Overrides
. <{awk '/^# Overrides/, 0' $local </dev/null} . <{awk '/^# Overrides/, 0' $local </dev/null}
if('fn?' Action-overridekeys)
Action-overridekeys
if not
. `{config_whatis overridekeys}
# Misc Setup # Misc Setup
Action status & Action status
progs_file=$WMII_NS_DIR/proglist.$pid progs_file=$WMII_NS_DIR/proglist.$pid
proglist $PATH >$progs_file & proglist $PATH >$progs_file &

View File

@ -29,7 +29,7 @@ wmiir write /colrules <<!
wmiir write /tagrules <<! wmiir write /tagrules <<!
/XMMS.*/ -> ~ /XMMS.*/ -> ~
/MPlayer.*/ -> ~ /MPlayer.*/ -> ~
/.*/ -> ! /.*/ -> sel
/.*/ -> 1 /.*/ -> 1
! !