ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RP] it's what you've all been waiting for! (maybe)


From: Shawn Betts
Subject: Re: [RP] it's what you've all been waiting for! (maybe)
Date: Sat Jun 21 23:57:03 2003
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Jay Belanger <address@hidden> writes:

> Shawn Betts <address@hidden> writes:
> 
> > Hi folks,
> > 
> > So I've committed a script, contrib/rpws, which allows you to use
> > workspaces in ratpoison.
> 
> I'm not sure how much I'll use it, if at all, but I'd like to play
> with it.  I'm feeling kinda dumb, but I just checked out the latest
> CVS and can't find it, in the contrib directory or elsewhere.  
> How do I get to it?

Well, it beats me. The web CVS thingy doesn't show the commit I made
today. But ratpoison-commits shows my commit.

I'll see if I can figure out what's up...

Shawn

--- Begin Message --- Subject: [RPC] CVS: ratpoison/contrib rpws,NONE,1.1 Makefile.am,1.4,1.5 Date: Sat, 21 Jun 2003 18:41:46 -0700
Update of /cvsroot/ratpoison/ratpoison/contrib
In directory sc8-pr-cvs1:/tmp/cvs-serv26638/contrib

Modified Files:
        Makefile.am 
Added Files:
        rpws 
Log Message:
(bin_SCRIPTS): add rpws


--- NEW FILE ---
#!/bin/sh
#
# Workspaces for ratpoison
# Copyright (C) 2003 Shawn Betts
# Author: Shawn Betts
#
# To enable workspaces, put the following lines in your .ratpoisonrc
# file:
#
# exec rpws -i
# exec rpws -b
#
# The first line initializes the workspaces (never call this more than
# once or it will clutter ratpoison with duplicate window groups). The
# second line sets up some keybindings:
#
# C-t M-1 Workspace 1
# C-t M-2 Workspace 2
# ...
# C-t M-7 Workspace 7
#
# You want more workspaces? Edit this script.
#
# Code:
#

RATPOISON=ratpoison

function rp_call ()
{
    echo "$RATPOISON -c \"$*\"" >/tmp/cmds
    $RATPOISON -c "$*"
}

function ws_init_ws ()
{
    rp_call gnew ws$1
    rp_call setenv fs$1 `rp_call fdump`
}

function ws_init ()
{
    # Backup the frames
    FS=`rp_call fdump`
    rp_call select -
    rp_call only

    # Make 6 workspaces
    ws_init_ws 2
    ws_init_ws 3
    ws_init_ws 4
    ws_init_ws 5
    ws_init_ws 6
    ws_init_ws 7

    # Workspace 1 uses the 'default' group.
    # Start in workspace 1.
    rp_call gselect default
    rp_call setenv fs1 `rp_call fdump`
    rp_call setenv ws 1

    # restore the frames
    echo $FS
    rp_call frestore $FS
}

function ws_save ()
{
    WS=`rp_call getenv ws`
    rp_call setenv fs$WS `rp_call fdump`
}

function ws_restore ()
{
    ws_save
    if [ $1 == 1 ]; then
        rp_call gselect default
    else
        rp_call gselect ws$1
    fi
    rp_call echo Workspace $1
    rp_call frestore `rp_call getenv fs$1`
    rp_call setenv ws $1
}

function ws_bindings ()
{
    # Use $0 so we know the name and location of the script to call.
    rp_call bind M-1 exec $0 1
    rp_call bind M-2 exec $0 2
    rp_call bind M-3 exec $0 3
    rp_call bind M-4 exec $0 4
    rp_call bind M-5 exec $0 5
    rp_call bind M-6 exec $0 6
    rp_call bind M-7 exec $0 7
}

if [ -z $@ ]; then
    echo "Usage:"
    echo "$0 -i      -- initialize the workspaces"
    echo "$0 -b      -- setup some key bindings"
    echo "$0 <n>     -- Switch to workspace n"
else
    if [ $1 == -i ]; then
        ws_init
    elif [ $1 == -b ]; then
        ws_bindings
    else
        ws_restore $1
    fi
fi

Index: Makefile.am
===================================================================
RCS file: /cvsroot/ratpoison/ratpoison/contrib/Makefile.am,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Makefile.am 8 Dec 2001 23:13:50 -0000       1.4
+++ Makefile.am 22 Jun 2003 01:41:44 -0000      1.5
@@ -1,2 +1,4 @@
+bin_SCRIPTS = rpws
+
 pkgdata_DATA = ratpoison.el split.sh genrpbindings
 EXTRA_DIST    = ratpoison.el split.sh genrpbindings



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
Ratpoison-commits mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/ratpoison-commits

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]