diff --git a/man/wmii.1 b/man/wmii.1 index 48223a07..f382b2c8 100644 --- a/man/wmii.1 +++ b/man/wmii.1 @@ -1,5 +1,5 @@ '\" 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. .de Vb .ft CW @@ -10,7 +10,7 @@ .fi .. -.TH "WMII" "1" "11 June 2007" "" "" +.TH "WMII" "1" "26 June 2007" "" "" .SH NAME wmii\-VERSION .PP @@ -436,16 +436,15 @@ Rules are specified: \fB \fP .br When a client\&'s \fIname\fP:\fIclass\fP:\fItitle\fP -matches \fIregex\fP, -it is given the tagstring -\fItag\fP\&. -There are two special tags. \fI!\fP, -which -will be replaced with \fIsel\fP -in the future, +matches +\fIregex\fP, +it is given the tagstring \fItag\fP\&. +There are +two special tags. \fI!\fP, +which is deprecated, and identical +to \fIsel\fP, represents the current tag. \fI^\fP -represents the -floating layer. +represents the floating layer. .TP keys The \fIkeys\fP diff --git a/man/wmii.tex b/man/wmii.tex index dda14175..9b10a154 100644 --- a/man/wmii.tex +++ b/man/wmii.tex @@ -202,7 +202,7 @@ follows. \begin{description} \item[colrules] The \emph{colrules} file contains a list of rules which affect the width of newly created columns. - Rules have the form: \\ \SP % Yuck! + Rules have the form: \\ \SP % Yuck! (kludge) \MANbr \SP\SP /\Arg{regex}/ -> \Arg{width}\oArg{+width...} \\ \SP \MANbr @@ -218,12 +218,11 @@ follows. \MANbr \SP\SP /\Arg{regex}/ -> \Arg{tag}\oArg{+tag...} \\ \SP \MANbr - When a client's \Arg{name}:\Arg{class}:\Arg{title} - matches \Arg{regex}, it is given the tagstring - \Arg{tag}. There are two special tags. \emph{!}, which - will be replaced with \emph{sel} in the future, - represents the current tag. \emph{\Circum} represents the - floating layer. + When a client's \Arg{name}:\Arg{class}:\Arg{title} matches + \Arg{regex}, it is given the tagstring \Arg{tag}. There are + two special tags. \emph{!}, which is deprecated, and identical + to \emph{sel}, represents the current tag. \emph{\Circum} + represents the floating layer. \item[keys] The \emph{keys} file contains a list of keys which \Prog{wmii} will grab. Whenever these key combinations are pressed, the string which represents them are diff --git a/rc/rc.wmii.rc b/rc/rc.wmii.rc index 9e6e0b66..1414259d 100755 --- a/rc/rc.wmii.rc +++ b/rc/rc.wmii.rc @@ -31,8 +31,10 @@ fn 9menu { fn config_whatis { confpath=`{echo $WMII_CONFPATH | sed 'y/:/ /'} - prog=$1; shift - echo `{{path=$confpath whatis $prog} | grep -v '=|^fn '} $* + prog = `{{path=$confpath whatis $1} | grep -v '^fn|= '}; shift + if(~ $#prog 0) + prog = /dev/null + echo $prog $* } if(echo $0 | grep -vs '/rc.wmii$') { @@ -52,10 +54,6 @@ rc.wmii can't run: wmiirc will be run instead. ! -# Source Variables, &c -local = `{config_whatis rc.wmii.local} -. <{awk '//; /^# Overrides/ { exit }' $local 60+40 @@ -65,7 +63,7 @@ wmiir write /colrules < ~ /MPlayer.*/ -> ~ -/.*/ -> ! +/.*/ -> sel /.*/ -> 1 ! @@ -74,18 +72,37 @@ fn status { echo -n `{uptime | sed 's/.*://; s/,//g'} '|' `{date} } +# Functions fn viewtitle { echo $* } -# Events -fn Event-Start { - switch($1) { - case wmiirc - rm -f $progs_file - exit - } +fn proglist { + /bin/ls -lL `{echo $* | sed 'y/:/ /'} >[2]/dev/null \ + | awk '$1 ~ /^[^d].*x/ { print $NF }' \ + | sort | uniq } -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-DestroyTag { wmiir remove /lbar/$"* } @@ -112,14 +129,16 @@ fn Event-ClientMouseDown { } } +fn 'fn?' {rc -c 'whatis '$1 >[2]/dev/null | grep -s '^fn ' } + # Actions fn Action { - action=$1; shift - if(whatis Action-$action | grep -s '^fn ') { - Action-$action $* & - };if not { - run_command `{config_whatis $action} $* & - } + cmd=$1 action=Action-$cmd { shift + if('fn?' $action) + $action $* + if not + run_command `{config_whatis $cmd} $* + } & } fn Action-rehash { proglist $PATH >$progs_file } fn Action-quit { wmiir xwrite /ctl quit } @@ -133,6 +152,30 @@ fn Action-status { 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 - <[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 wmiir write /ctl <$progs_file & diff --git a/rc/wmiirc.sh b/rc/wmiirc.sh index e78ae709..2c988a55 100644 --- a/rc/wmiirc.sh +++ b/rc/wmiirc.sh @@ -29,7 +29,7 @@ wmiir write /colrules < ~ /MPlayer.*/ -> ~ -/.*/ -> ! +/.*/ -> sel /.*/ -> 1 !