[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RP] command interactivity
From: |
sabetts |
Subject: |
[RP] command interactivity |
Date: |
Sat, 18 Aug 2001 15:06:33 -0700 (PDT) |
I made some changes to actions.c mostly. Commands can now be called
interactively and non-interactively. Right now, using ratpoison -c will call
the command non-interactively and the colon command and keystrokes call them
interactively. It is up to the command to behave differently. Currently all
commands behave the same except for the windows command which, when called
non-interactively returns a the list of windows as a string which is then
passed back to the 'client' that issued the command. This brings me to the
other change: commands can now return strings. Right now, these strings are
ignored except if they are called through the ratpoison -c mechanism, in which
case the string is printed (easiest if you try it yourself).
This should allow ratpoison scripting to actually do something useful. You
could write a script that checked the window list for, say, emacs and if its
there switch to the window otherwise start it up. Fun fun fun!
Let me know if you have any problems. There are some elusive race conditions
with the ratpoison -c mechanism that Ryan and I noticed but I've been unable to
replicate them. Basically stuff starts hanging. Its not fatal, but it could
mess a script up pretty good. We managed to mess things up by hammering on
ratpoison in this manner:
while true; do ratpoison -c "next"; done
and then sending keystrokes to split the screen and whatnot. Its easiest to do
with 2 machines so you can stop the madness :).
If you're looking for something to do, you could write some ratpoison wrapper
functions for python, perl, elisp, clisp, bash, C, etc to avoid having to type
ratpoison -c "cmd" all the time. Instead you could type rp_next(), for
instance. Something to do if you're bored, anyway...
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [RP] command interactivity,
sabetts <=