From a8d94d22eec2d76c84287dd412eff0db60e48670 Mon Sep 17 00:00:00 2001 From: sabetts Date: Thu, 26 Jun 2003 02:10:38 +0000 Subject: * contrib/rpws: only set RATPOISON if it's not already set. * contrib/rpws: call /bin/bash (rp_call): remove extraneous 'function' keyword in function declaration. (ws_init_ws): likewise (ws_init): likewise (ws_save): likewise (ws_restore): likewise (ws_bindings): likewise --- contrib/rpws | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'contrib') diff --git a/contrib/rpws b/contrib/rpws index ccf7e14..a2372a7 100755 --- a/contrib/rpws +++ b/contrib/rpws @@ -21,23 +21,32 @@ # # You want more workspaces? Edit this script. # + +# FIXME: Currently this depends on bash because I can't figure out how +# to pass argument to these functions. In bash $1 ... $n are bound to +# them, not so in plain bourne. +# # Code: # -RATPOISON=ratpoison +# This allows outside scripts to tell this script where to find +# ratpoison. +if [ -z $RATPOISON ]; then + RATPOISON=ratpoison +fi -function rp_call +rp_call () { $RATPOISON -c "$*" } -function ws_init_ws +ws_init_ws () { rp_call gnew ws$1 rp_call setenv fs$1 `rp_call fdump` } -function ws_init +ws_init () { # Backup the frames FS=`rp_call fdump` @@ -59,17 +68,16 @@ function ws_init rp_call setenv ws 1 # restore the frames - echo $FS rp_call frestore $FS } -function ws_save +ws_save () { WS=`rp_call getenv ws` rp_call setenv fs$WS `rp_call fdump` } -function ws_restore +ws_restore () { ws_save if [ $1 == 1 ]; then @@ -82,7 +90,7 @@ function ws_restore rp_call setenv ws $1 } -function ws_bindings +ws_bindings () { # Use $0 so we know the name and location of the script to call. rp_call bind M-1 exec $0 1 @@ -94,6 +102,8 @@ function ws_bindings rp_call bind M-7 exec $0 7 } +echo boom >/tmp/boom + if [ -z $@ ]; then echo "Usage:" echo "$0 -i -- initialize the workspaces" -- cgit v1.2.3