On Tuesday, 17 August 2004 at 11:38:33 -0400, Duane Winner wrote: > Hello, > > Hey, does anybody know of any useful tricks for automating xtset or > xtermset? > > I use xtset to set the title and icon labels to [EMAIL PROTECTED]:path so I can > keep track of my xterms littered all over my desktop (pretty frequent! :) > > But it sure would be nice to have them updated whenever I 'cd' to > another directory or 'su' to another user or 'ssh' to another host! > > I'm sure there's got to be someway to make this a little more seamless > then running # xtset [EMAIL PROTECTED]:`pwd` everytime, but I'm just not good enough > with shell programming to know how to do this. > > The closest I came was writing a small bash script that does: > > for filename in /dev/ttyp*; do > /usr/local/bin/xtset [EMAIL PROTECTED]:`pwd` > "$filename" > done
Here's what I do (in .bashrc): ssh () { xtset -t $* xtset -i "[EMAIL PROTECTED]:%D" command ssh $* xtset -t "%u (%T) %h:%D" xtset -i "[EMAIL PROTECTED]:%D" } cd () { command cd $* if [ $? = 0 ]; then xtset -t "%u (%T) %h:%D" xtset -i "[EMAIL PROTECTED]:%D" true else false fi } xtset -t "%u (%T) %h:%D" xtset -i "[EMAIL PROTECTED]:%D" The last two lines set the initial heading. Note also that you can set headings from another window: xtset writes to its stdout, so this will do what you expect: xtset "Foo bah baz" >/dev/ttyp5 Greg -- When replying to this message, please copy the original recipients. If you don't, I may ignore the reply or reply to the original recipients. For more information, see http://www.lemis.com/questions.html Note: I discard all HTML mail unseen. Finger [EMAIL PROTECTED] for PGP public key. See complete headers for address and phone numbers.
pgpni255cb8jx.pgp
Description: PGP signature