diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2009-09-13 12:54:00 +0200 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2009-09-13 12:54:00 +0200 |
commit | 1ea0974d24752d1a3ab87d421ff9b47882f03c57 (patch) | |
tree | 0f3e70c6fbb52829a6ea7ecab6a78ab6bb43971c /examples/data/uzbl/scripts/instance-select-wmii.sh | |
parent | 0842d72ceac26185c51f9b0688107eb1faa6931d (diff) |
sample wmii integration script
Diffstat (limited to 'examples/data/uzbl/scripts/instance-select-wmii.sh')
-rwxr-xr-x | examples/data/uzbl/scripts/instance-select-wmii.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/examples/data/uzbl/scripts/instance-select-wmii.sh b/examples/data/uzbl/scripts/instance-select-wmii.sh new file mode 100755 index 0000000..2c77600 --- /dev/null +++ b/examples/data/uzbl/scripts/instance-select-wmii.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# This script lists all uzbl instances in the current wmii tag +# You can select one of them, and it will focus that window +# It does not change the layout (stacked/tiled/floating) nor does it +# changes the size or viewing mode of a uzbl window +# When your current uzbl window is maximized, the one you change to +# will be maximized as well. +# See http://www.uzbl.org/wiki/wmii for more info + +COLORS=" -nb #303030 -nf khaki -sb #CCFFAA -sf #303030" + +if dmenu --help 2>&1 | grep -q '\[-rs\] \[-ni\] \[-nl\] \[-xs\]' +then + DMENU="dmenu -i -xs -rs -l 10" # vertical patch +else + DMENU="dmenu -i" +fi + +list= +# get window id's of uzbl clients. we could also get the label in one shot but it's pretty tricky +for i in $(wmiir read /tag/sel/index | grep uzbl |cut -d ' ' -f2) +do + label=$(wmiir read /client/$i/label) + list="$list$i : $label\n" +done +window=$(echo -e "$list" | $DMENU $COLORS | cut -d ' ' -f1) +echo "focusing window $window" +wmiir xwrite /tag/sel/ctl "select client $window" |