commit 1d63abd1fd10163850a1c65e2a1e67e676c666a6 parent 3a636724dce07ef4d0d3c871d0495f62011580f2 Author: Luka Novsak <lukanovsak@gmail.com> Date: Thu, 25 Jun 2009 10:32:55 +0200 Added client search code snippet Diffstat:
| M | wmii.suckless.org/code_snippets/plan_9_port/index.md | | | 23 | +++++++++++++++++++++++ |
1 file changed, 23 insertions(+), 0 deletions(-)
diff --git a/wmii.suckless.org/code_snippets/plan_9_port/index.md b/wmii.suckless.org/code_snippets/plan_9_port/index.md @@ -145,3 +145,26 @@ Add this to your rc.wmii BEFORE the other keys (you still want your other old ke key $MODKEY-A-^(a b c d e f g h i j k l m n o p q r s t u v w x y z) || fn $key { TagCycle $1} +Find and go to clients +---------------------- + + fn title { + echo `{wmiir read /client/$1/label}} + + fn focusclient { + tag=`{wmiir read /client/$1/tags | cut -d+ -f1} + wmiir xwrite /ctl view $tag + wmiir xwrite /tag/$tag/ctl select client $1} + + key $MODKEY-u || fn $key { + ifs=$wi_nl { + clients=`{wmiir ls /client | head -n -1 | sed 's/\/$//'} + sel=`{{for(c in $clients) echo `{title $c}} | sort | uniq -u | wimenu -i} + if(test $sel) { + for(c in $clients) { + if(~ $sel `{title $c}) + match=$c + } + if(test $match) + focusclient $match}}} +