summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/rpws26
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"