LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   custom xterm title when already defined in .bashrc (https://www.linuxquestions.org/questions/linux-software-2/custom-xterm-title-when-already-defined-in-bashrc-186641/)

brian0918 05-27-2004 03:46 PM

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
xterm*)
PS1="\[\033]0;home \W\007\]home \W $ "
;;
*)
PS1="home \W $ "
;;
esac


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.


Thanks.

brian0918 06-01-2004 11:17 AM

anyone??? :(


All times are GMT -5. The time now is 11:10 AM.