[openbox] openbox focus wish list

Bobby R. Cox bcox at pmt.org
Wed Oct 8 10:13:15 EDT 2003


On Wed, 2003-10-08 at 11:51, Robert Upshall wrote:
> On Tue, 2003-10-07 at 11:25, Brett Campbell wrote:
> > > While this is good, is there a way to make the terminal title dynamic? 
> > 
> > I make my aterms dynamic by including this in my .zshrc:
> > 
> > # set titlebar and icon_name text if we're in X11
> > chpwd() {
> >     [[ -t 1 ]] || return
> > 	[ -n "$DISPLAY" ] && print -Pn "\e]0;%~\a"
> > }
> > chpwd
> 
> does anybody have a bash version of this?
> 
> 
> 
> > 
> > Now, everytime i change directories or source my ~/.zshrc, the titlebar
> > is updated with the CWD.  I'm no guru, only a work-aroundist, and so
> > i've written several scripts as wrappers for commonly used applications
> > that change the titlebar text as needed. Here's an interesting one i use
> > when i login to my mail server:
> > 
> > #!/usr/bin/perl -w
> > 
> > $|++;   # piping-hot, bitch.
> > 
> > chomp ($host = `hostname`);
> > chomp ($user = `whoami`);
> > 
> > while (1) {
> >         open (LOAD, "/proc/loadavg") || die "Couldn't open " .
> > 											"/proc/loadavg: $!\n";
> >         @load = split (/ /, <LOAD>);
> >         close LOAD;
> > 
> >         print "\e]0;$user\@$host  -  LoadAvg: $load[0] $load[1] $load[2] at  ";
> >         print scalar(localtime), "\a";
> > 
> >         sleep 2;
> > }
> > 
> > Many may find this silly, but it keeps the loadavg updating every two
> > seconds in the titlebar *shrug*
> > 
> > > AAhh, this is what PROMPT_COMMAND is for.   never mind.
> > Hmmm... never heard of this :-)  Interesting.
> > 
> > Have fun!

This is from the my .bashrc

# Change the window title of X terminals 
case $TERM in
        xterm*|rxvt|Eterm|eterm)
               PROMPT_COMMAND='echo -ne
"\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
        ;;
    screen)
               PROMPT_COMMAND='echo -ne
"\033_${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\033\\"'
        ;;
esac

-- 
Bobby R. Cox
Linux Systems Administrator
Project Mutual Telephone
bcox at pmt.org
208.434.7185
--------------------------------------------------------
Surprise your boss.  Get to work on time.




More information about the openbox mailing list