[hackers] [sites] Added client search code snippet || Luka Novsak

From: <hg_AT_suckless.org>
Date: Sun, 16 Aug 2009 10:54:14 +0000 (UTC)

changeset: 123:c113cf11d44b
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
@@ -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 Sun Aug 16 2009 - 10:54:14 UTC

This archive was generated by hypermail 2.2.0 : Sun Aug 16 2009 - 14:19:54 UTC