diff options
author | sabetts <sabetts> | 2003-06-26 02:10:38 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2003-06-26 02:10:38 +0000 |
commit | a8d94d22eec2d76c84287dd412eff0db60e48670 (patch) | |
tree | b8de01130c2a1585d01187e80b7a14c9e9d3bd28 /contrib/rpws | |
parent | c6ee0ca66101f88438ff9e4dd8979c5bdfc40912 (diff) | |
download | ratpoison-a8d94d22eec2d76c84287dd412eff0db60e48670.zip |
* 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
Diffstat (limited to 'contrib/rpws')
-rwxr-xr-x | contrib/rpws | 26 |
1 files changed, 18 insertions, 8 deletions
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" |