ratpoison-devel
[Top][All Lists]
Advanced

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

Re: [RP] Patch to stop shells from being left around


From: Mike Meyer
Subject: Re: [RP] Patch to stop shells from being left around
Date: Sat Oct 6 12:19:03 2001

Doug Kearns <address@hidden> types:
> Mike Meyer wrote:
> >That's why I wrote the "ratpoison-get-a" script, to find a foo if I've
> >got it running, and if not to run a foo. I tend to have a lot of
> >things running at one time. Which is why the patch after the next was
> >going to be one to do something about the bar for "windows". I find
> >that it's frequently wider than my screen.
> If your still keen something similar to the new 'windowlist' command in 
> screen-3.9.11beta1 would be great :)

Nah - ratmenu will does the trick with a little scripting. I tried
writing it as a shell command - then a script - and kept getting bit
by backtick parsing not recognizing quotes :-(. So I gave up and wrote
it in Python. Apologies to anyone who uses it and has to change the
paths.

        <mike

#!/usr/opt/bin/python

"""Use the ratpoison command to build a menu of windows to hand to ratmenu.

Any arguments will be passed to ratmenu before the list of window menu 
entries."""

import sys, os

argv = sys.argv
argv[0] = "ratmenu"

winfile = os.popen('ratpoison -c "windows %n:%s:%t"')
for win in winfile.readlines():
    number, status, name = win.split(':', 2)
    argv.append('%s%s%s:ratpoison -c "select %s"' %
                (number, status, name[:-1].replace(':', '!'), number))
winfile.close()

os.execv("/usr/X11R6/bin/ratmenu", argv)


--
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]