aboutsummaryrefslogtreecommitdiff
path: root/ratpoison/workspace_menu
diff options
context:
space:
mode:
authorVasil Zlatanov <vasil.zlatanov@gmail.com>2014-02-23 16:59:47 +0100
committerVasil Zlatanov <vasil.zlatanov@gmail.com>2014-02-23 16:59:47 +0100
commit4b66da7ff8060fffdeac1cc4cb27f3182b3f2d46 (patch)
treed596ad6a67295d3f46e4ab189fd2b3539ea83c10 /ratpoison/workspace_menu
downloaddotfiles-4b66da7ff8060fffdeac1cc4cb27f3182b3f2d46.tar.gz
dotfiles-4b66da7ff8060fffdeac1cc4cb27f3182b3f2d46.tar.bz2
dotfiles-4b66da7ff8060fffdeac1cc4cb27f3182b3f2d46.zip
First commit of dotfiles.
Diffstat (limited to 'ratpoison/workspace_menu')
-rwxr-xr-xratpoison/workspace_menu18
1 files changed, 18 insertions, 0 deletions
diff --git a/ratpoison/workspace_menu b/ratpoison/workspace_menu
new file mode 100755
index 0000000..020f887
--- /dev/null
+++ b/ratpoison/workspace_menu
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+# Lets you switch between all workspaces in a way that minimizes keystrokes.
+# The current workspace is selected.
+
+# Yes, bash is really necessary, because it's version of printf makes this
+# script possible. Regular bourne shell printf does NOT.
+
+workspace_command="/usr/bin/rpws"
+
+( printf "ratmenu -style dreary -fg '#657b83' -bg '#eee8d5' -io $[ $($workspace_command current) + 1 ]";
+ ratpoison -c "groups" | while read s; do
+ n=$(echo $s | sed 's/\([0-9]\+\).*/\1/');
+ w=$(echo $s | sed 's/[0-9]\+.\(.*\)/\1/');
+ a=$(printf "%3q %q" $n $w); b="$workspace_command $n";
+ printf " %q %q" "$a" "$b";
+ done; echo \;) | sh
+