Argh, so many answers...
I tried wmctrl, which almost worked, except I couldnt get it to change the icon title, at least not permanently.
The solution is that PS1 in ubuntu sets the title.
The default PS1 is
... which sets the title in the first escape sequence.
Thus, there are two solutions:
Solution 1: simplify PS1, then use PROMPT_COMMAND
Change PS1 to something simpler:
... then use the PROMPT_COMMAND:
PROMPT_COMMAND='echo -ne "\033]0;SOME TITLE HERE\007"'
Solution 2: directly modify PS1
Simply modify PS1 with new title: