I had this exact same problem.
So I wrote a shell script that I bound to a hotkey.
When I hit the hotkey, it gets the window id of the currently active window (the one that has focus).
Then it gives you a popup dialog where you enter the title you want that window to have.
Then every time that window changes its name, it changes it back to the title you want.
To use the script, you need:
(I wrote it in fish rather than bash cuz bash gives me a headache)
some way to bind the script to a hotkey
xbindkeys, cuz all I had to do to get it to work was add:
"[PATH TO SCRIPT]/[NAME OF SCRIPT]"
Mod4 + t
(that is, window key + t)
Thanks to this dude, who gave me the info on the magic xprop stuff.
(Like, a year ago, and then I never got around to writing the script til today. xD )
P.S. If any newbie finds this answer and doesn't know how to use it, just ask me and I'll walk you through it. ^^
EDIT: I updated it so that you can use it from the command line with the switches
Here's the script:
# this block is so you can use it from the command line with -t and -w
if test "$argv" != "" -a (math (count $argv)%2 == 0)
for i in (seq 1 (count $argv))
if test $argv[$i] = '-t'
set title_i_want $argv[(math 1 + $i)]
else if test $argv[$i] = '-w'
set window_id $argv[(math 1 + $i)]
if not test $window_id
echo "YOU DIDN'T ENTER A `window_id` WITH `-w`,
SO MAKE SURE THE WINDOW YOU WANT HAS FOCUS
TWO SECONDS FROM NOW!"
# get the id of the currently focused window
if not test $window_id
set window_id (xprop -root _NET_ACTIVE_WINDOW | grep -P -o "0x\w+")
# get the title to force on that window
if not test $title_i_want
set title_i_want (kdialog --title "entitled" --inputbox "type the title you want and hit enter.
to stop renaming,
just enter nothing and hit esc")
# this bit is needed for a kludge that allows window renaming
set has_renamed_before "FALSE"
set interrupt_message "WAIT WAIT I WANT A TURN BLOO BLOO BLEE BLUH BLOO" # hopefully i never want to actually use that as a title xD
xprop -f _NET_WM_NAME 8u -set _NET_WM_NAME $interrupt_message -id $window_id
# take the output of xprop
# pipe it into a while loop
# everytime it outputs a new line
# stuff it into a variable named "current_title"
xprop -spy _NET_WM_NAME -id $window_id | while read current_title
# cut off extraneous not-the-title bits of that string
set current_title (echo $current_title | grep -P -o '(?<=_NET_WM_NAME\(UTF8_STRING\) = ").*(?="\z)')
# if the current title is the interrupt message
# this script has renamed the window at least once before
# then we wanna let the new name take over
if test $current_title = $interrupt_message -a $has_renamed_before = "TRUE"
# if title_i_want is an empty string, exit
else if test $title_i_want = ""
xprop -f _NET_WM_NAME 8u -set _NET_WM_NAME "WIDNOW WILL START RENAMING ITSELF AS NORMAL" -id $window_id
# otherwise just change the title to what i want
else if test $current_title != $title_i_want
xprop -f _NET_WM_NAME 8u -set _NET_WM_NAME "$title_i_want" -id $window_id
set has_renamed_before "TRUE"