summaryrefslogtreecommitdiff
path: root/ratws
diff options
context:
space:
mode:
authorTslil Clingman <hiato1@gmail.com>2014-12-05 11:59:55 +0200
committerTslil Clingman <hiato1@gmail.com>2014-12-05 11:59:55 +0200
commit2dc2feacf35cfebade39b2e2797e02ac6d84c4c4 (patch)
treefb91f5b3e1bda2479686c2344bbff28a21af4d28 /ratws
parentefd9525d83d25ae2cd3c308e4a6ca25fc8f5aeb1 (diff)
Tweaks and ratpoison window switcher
Diffstat (limited to 'ratws')
-rwxr-xr-xratws14
1 files changed, 14 insertions, 0 deletions
diff --git a/ratws b/ratws
new file mode 100755
index 0000000..7f55235
--- /dev/null
+++ b/ratws
@@ -0,0 +1,14 @@
+#!/usr/bin/env dash
+
+font="-*-fixed-medium-*-*-*-12-*-*-*-*-*-*-*"
+screen=$(ratpoison -c sdump | tr ',' '\n' | grep '1$')
+width=$(echo $screen | cut -d ' ' -f 4)
+height=$(echo $screen | cut -d ' ' -f 5)
+s=$(echo $screen | cut -d ' ' -f 1)
+w=$(($width/3))
+h=$(($height/3))
+
+alias dm="dmenu -l 16 -s $s -x $w -y $h -w $w -p \"Select >\" -sb '#0B0' -sf black -nb '#000' -fn $font -i"
+
+sel=$(ratpoison -c windows | dm | cut -d ' ' -f 1)
+[ ! "$sel" = "" ] && ratpoison -c "select $sel" || true