LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   manipulating gnome-terminal title, post-creation (https://www.linuxquestions.org/questions/linux-desktop-74/manipulating-gnome-terminal-title-post-creation-532879/)

dengel 02-27-2007 07:53 AM

manipulating gnome-terminal title, post-creation
 
Is there a way to change the title text of a gnome-terminal, using a command from inside the terminal that you want to change?

I know you can set the title on creating a terminal using the --title command line option, and I know that you can arbitrarily change the title of a running gnome-terminal manually by using the menu system.

But what if you want to manipulate the title from within a script? I can't find any reference in the documentation to how to do this.

Thanks in advance for any info. Apologies if it's right there and I'm missing it.

-Dan

cgjones 02-28-2007 01:02 AM

I'm not sure if this is quite what you are looking for, but I pulled this from my .bashrc on my Debian Etch system. This dynamically sets the window title to whatever user/host combination I currently am logged in as.

Code:

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
#    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}\007"'
    ;;
*)
    ;;
esac


dengel 02-28-2007 09:43 AM

almost
 
Thanks for the hint. That does, indeed, work--almost. It sets the title, which is then immediately replaced by gnome-terminal's "chosen" title again. (I can see it flash my new title up for the briefest moment.)

I just can't imagine that gnome doesn't provide a basic way to control something like that programmatically--even more basic than writing escape sequences to the terminal.

I might just see if I can write small program that finds the gnome-terminal CORBA object and sets the title that way.


All times are GMT -5. The time now is 01:35 PM.