custom xterm title when already defined in .bashrc
Here is my problem:
In .bashrc I already have the lines that change the xterm title depending on the directory you are in:
case $TERM in
PS1="\[\033]0;home \W\007\]home \W $ "
PS1="home \W $ "
Now, in a separate script in another directory, I want to be able to change the titlebar again. The script updates (sleeps) every 30 seconds, and has a couple variables defined within that I would like to have displayed in the titlebar. Compared to above, I would like it to say something like:
PS1="\[\033]0;home $max of $total running\007\]home \W $ " (not sure if syntax is correct)
where $max and $total are my variables defined in that script.
So, is there any way to set this up so that if the script isn't running, it uses the titlebar defined in .bashrc, but if the script is running, it uses a titlebar defined, as shown above, preferably within the script itself.
Last edited by brian0918; 05-27-2004 at 05:04 PM.