ratpoison-devel
[Top][All Lists]
Advanced

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

[RP] more with the scripts...


From: Joe Corneli
Subject: [RP] more with the scripts...
Date: Tue, 08 Feb 2005 13:15:41 -0600

OK, so here's a reprisal of the situation I'm in vis a vis scripts.

My path looks like this -- some redundancy I'm not happy about,
probably because of the path being set in my .tcshrc instead of
something that just runs _once_.

 
/sw/bin:/sw/sbin:/Users/arided/bin/:/sw/bin/:/usr/local/bin/:/Users/arided/bin/:/sw/bin/:/usr/local/bin/:/Users/arided/bin/:/sw/bin/:/usr/local/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/Users/arided:/usr/X11R6/bin

But OK, we'll proceed - at least it isn't as horrible as it was
before.

Now, in terms of what works and what doesn't.

I have a little script called "zippy" that Trent will remember.

Running this script gives a quote from zippy:

% /Users/arided/bin/zippy
These PRESERVES should be FORCE-FED to PENTAGON OFFICIALS!!

And moreover, running the script through ratpoison as follows causes
a quote to be sent to the bar:

% /Users/arided/ratpoison/src/ratpoison -c "echo `/Users/arided/bin/zippy`"
[bar:] HELLO, everybody, I'm a HUMAN!

Fine and good.  Now, I want to be able to do this from within
Ratpoison, so I try

 alias zippy exec /Users/arided/ratpoison/src/ratpoison -c "echo 
`/Users/arided/bin/zippy`"

But then, alas, :zippy doesn't print anything to the bar.

For anyone who wants to try this at home, here's the text of zippy:

===================================================================
#!/bin/bash

emacs -q --no-site-file --batch -f yow > taco 2>&1
grep -v "CONSING" taco
===================================================================

Now here's an interesting fact that I didn't notice in previous
conversations.

% zippy
We just joined the civil hair patrol!
% cat taco
Am I CONSING yet?...
I have SEEN the CONSING!!
We just joined the civil hair patrol!

However!!  

:zippy

% cat taco
Am I CONSING yet?...
I have SEEN the CONSING!!

A potential clue!  So, it appears that zippy is being run after all.
But what the hell?  Zippy didn't get to say anything substantial this
time.  So, it seems to me, that there's something very weird going on.

(Note that as you'd expect this form

% /Users/arided/ratpoison/src/ratpoison -c "echo `/Users/arided/bin/zippy`"
[bar:] Why was I BORN?

works fine

% cat taco
Am I CONSING yet?...
I have SEEN the CONSING!!
Why was I BORN?

so whatever it is that plagues RP's alias doesn't affect straight-up
command-line interaction.)

==

Now, the same basic problem applies to scripts that _do_ things, not
just scripts that _print_ things.  For example, the script copyet
is supposed to copy screen's cut buffer to X's --

Trying 

% /Users/arided/ratpoison/src/ratpoison -c "exec /Users/arided/bin/copyet" 

causes an error message to print to the bar.  But very cleverly, I
thought I'd try to trick ratpoison, so I ran

% /Users/arided/ratpoison/src/ratpoison -c "echo `/Users/arided/bin/copyet`" 

Nothing is echoed (copyet has no output), but the desired effect is
achieved, 'cause next time I paste something, it is what I'd copied in
screen.  But of course(?) this same approach fails when I try to make
an alias to do the same thing.

Here's the code for copyet

===================================================================
#!/bin/sh copyet
screen -X writebuf /tmp/foo$$ && cat /tmp/foo$$ | xsel -i -b
rm -f /tmp/foo$$
===================================================================

Maybe this gives enough context for folks to help debug?  

I know Trent said to try compiling ratpoison with -DDEBUG, but he also
said to check whether taco contained the right filling... which it
doesn't.  So, anyway, that's the update - thanks for listening.

Joe




reply via email to

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