[wiki] [sandbox.suckless.org] Added client search code snippet || Luka Novsak
changeset: 123:c113cf11d44b
tag: tip
user: Luka Novsak <lukanovsak_AT_gmail.com>
date: Thu Jun 25 10:32:55 2009 +0200
files: wmii.suckless.org/code_snippets/plan_9_port/index.md
description:
Added client search code snippet
diff -r 88113d16289b -r c113cf11d44b wmii.suckless.org/code_snippets/plan_9_port/index.md
--- a/wmii.suckless.org/code_snippets/plan_9_port/index.md Sun Jun 21 16:28:49 2009 +0200
+++ b/wmii.suckless.org/code_snippets/plan_9_port/index.md Thu Jun 25 10:32:55 2009 +0200
_AT_@ -145,3 +145,26 @@
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}}}
+
Received on Thu Jun 25 2009 - 10:33:06 CEST
This archive was generated by hypermail 2.3.0
: Thu Sep 13 2012 - 19:30:40 CEST