How to set a windows's title in Linux

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.


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"