From 47a0a3f433f820fc78d180884f6ca376fba97b73 Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Sun, 12 Apr 2015 13:05:47 +0200 Subject: Tidy up everything :) --- tools/workspace_menu | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 tools/workspace_menu (limited to 'tools/workspace_menu') diff --git a/tools/workspace_menu b/tools/workspace_menu new file mode 100755 index 0000000..6fb6633 --- /dev/null +++ b/tools/workspace_menu @@ -0,0 +1,24 @@ +#!/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" +ratmenu="~/.tools/ratmenu" + +( printf "$ratmenu -style dreary -fg \"$COLOR11\" -bg \"$COLOR0\" -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/'); + w=$(ratpoison -c "gselect $(($n-1))" -c "windows %t" -c "gprev") + a=$(printf "%3q %q" $n $w); b="$workspace_command $n"; + if [ $n -ne 0 ];then + printf " %q %q" "$a" "$b"; + else + printf " %q %q" "Go to workspace:" "/bin/true"; + fi + done; echo \;) | sh + -- cgit v1.2.3-54-g00ecf