LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 02-27-2007, 07:53 AM   #1
dengel
LQ Newbie
 
Registered: Jun 2003
Distribution: Arch Linux
Posts: 23

Rep: Reputation: 0
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
 
Old 02-28-2007, 01:02 AM   #2
cgjones
Member
 
Registered: Nov 2005
Location: Central New York
Distribution: Ubuntu
Posts: 405

Rep: Reputation: 31
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
 
Old 02-28-2007, 09:43 AM   #3
dengel
LQ Newbie
 
Registered: Jun 2003
Distribution: Arch Linux
Posts: 23

Original Poster
Rep: Reputation: 0
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Get the title of xterm/gnome-terminal redleafong Linux - Software 6 01-10-2011 06:38 PM
weird terminal title bujecas Linux - General 5 09-28-2006 11:18 AM
UI suggestion for post title smileys slackhack LQ Suggestions & Feedback 2 07-01-2006 10:09 AM
How to change terminal title obnascar Linux - General 1 01-12-2006 02:41 PM
change window title in terminal sandman Linux - General 4 12-15-2002 03:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 12:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration