2

Is there a way to set a custom windows title in Linux?

4

One way of doing it is to use xdotool, e.g., from the commandline:

xdotool search --name "Old name" set_window --name "New name"

This searches open windows that contain the name "Old name" and changes its name to "New name". You also search by Window class, PID and a variety of other things. See the xdotool man page.

There are probably other ways of setting the same automatically when the program starts depending on the program, and whether it uses Qt, or GTK, or what.

2

If the window in question is an xterm, you can use a magic escape sequence:

echo "^[]0;New name^G"

where ^[ is the escape character and ^G is control-G.

If the window is the Gnome Terminal, you can use the menu item "Terminal|Set Title".

Another way to write it is

 echo "\033]0;New name\007"
  • Very interesting! – Ivan Z. G. Xiao Jun 4 '13 at 17:29
  • The octal escape codes work in Bash but might not be portable to other shells or echo implementations. – tripleee Mar 22 at 10:42

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.