ratpoison-devel
[Top][All Lists]
Advanced

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

Re: [RP] Meta/Generate and misc things


From: Mike Meyer
Subject: Re: [RP] Meta/Generate and misc things
Date: Fri Oct 5 00:39:03 2001

Gergely Nagy <address@hidden> types:
> However, I like your script, it could be added to the contrib/
> directory in cvs :)

In that case, you should use this version :-).

        <mike

#!/bin/sh
#
# Ask ratpoison if the first argument exists as a window. If so,
# select that window.  If not, then try running the second argument if
# present. If it isn't present, try running the first argument. Example
# usage with ratmenu:
#
# ratmenu "emacs:ratpoison-get-a emacs" "jpilot:ratpoison-get-a J-Pilot jpilot"

if [ -n "$1" ]
then
    window=$1
else
    echo "usage: $0 window [command]"
    exit 0
fi

window=$1
if [ -n "$2" ]
then
    command=$2
else
    command=$window
fi

if (ratpoison -c windows | grep -q $window)
then
    ratpoison -c "select $window"
else
    ratpoison -c "exec $command"
fi


--
Mike Meyer <address@hidden>                     http://www.mired.org/home/mwm/
Q: How do you make the gods laugh?              A: Tell them your plans.



reply via email to

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