2

I am using openbox and usually, I have a lot of windows on the screen. One window for the browser and a couple of windows to run a few terminals. The problem is that, when they are minimized, I am not able to figure out what I was doing in which terminal and having to open each terminal to check and see what I was doing is too cumbersome and time consuming. Not to mention, it also disrupts the flow of work. I mostly spend my time programming.

So I thought, it would make sense to change the name of the window in the title bar so that I can see what I was doing in it even when it is minimized. But unfortunately, openbox does not provide an option to change the name in the title bar of the window or maybe it does and I don't know. I've googled and I couldn't find anything that could help me.

I would like to know if there is a way to change the title of a window in its title bar so that I can see what I was doing in it, even when it is minimized.

Thank you.

1

You can tell xterm to change its Window title using escape sequences. At least with Gnome, this is also reflected in the task bar. Issuing the command

echo -e -n "\033]0;${USER}@${HOST}\007"

at the command prompt e.g. sets the title to user name and hostname. Of course you can put between "\033]0;" and "\007" any static strings, command output or environment variables you want. See the xterm title faq for more details and ideas.

This not only works for xterms but for many modern terminal emulators.

  • Could you please tell me where I type that command? in the terminal's config file? or at the prompt? – Jay Oct 18 '10 at 12:31
  • At the prompt. (I'll edit the answer to clarify) – fschmitt Oct 18 '10 at 12:32
  • 1
    I'm afraid that didn't work. But apparently it seems like, the command is the same, but you have to assign it to the environmental variable called PROMPT_COMMAND. So the actual command would be .... PROMPT_COMMAND='echo -ne "\033]0;"CUSTOMTEXT"\007"'. Ofcourse, it lasts only for that session. To reflect the changes across any newly created terminals, you have to export that variable. Thanks for your input none the less : ) – Jay Oct 18 '10 at 13:04
  • Wow, this is strange. It works in zsh but not in bash. In bash you need echo -e -n "\033]0;${USER}@${HOST}\007". I'll update my answer again... – fschmitt Oct 18 '10 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.