Is there a way to set a custom windows title in Linux?
Asked
Active
Viewed 1.5k times
8
-
1It might help to know if there's a particular program or set of programs that interest you. – frabjous Jan 01 '11 at 16:04
-
heres how to do it with xprop. https://askubuntu.com/a/626524/378854 – phil294 May 31 '18 at 18:20
2 Answers
5
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.
frabjous
- 10,755
- 3
- 34
- 27
-
The problem comes if you have two windows with the same name. Terminals for example are usually named like "user:host" – Adrian Lopez Jul 05 '20 at 15:03
-
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"
Kevin Panko
- 7,346
- 22
- 44
- 53
Shannon Nelson
- 1,327
- 7
- 12
-
-
The octal escape codes work in Bash but might not be portable to other shells or `echo` implementations. – tripleee Mar 22 '19 at 10:42
-