#!/usr/bin/env bash # Lets you switch between all workgroups in a way that minimizes keystrokes. # The current workgroup is selected. # Yes, bash is really necessary, because it's version of printf makes this # script possible. Regular bourne shell printf does NOT. rpws_command=/home/webb/scripts/ratpoison/rpws ( printf "ratmenu -style dreary -fg grey -bg blue -io $[ $($rpws_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="$rpws_command $n"; printf " %q %q" "$a" "$b"; done; echo \;) | sh