4

I've an application that I want to start via an entry in the upper gnome panel using a .desktop file, it has to run inside a terminal.

#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.0
Type=Application
Terminal=true
Icon[en_US]=/home/USER/bin/APPDIR/logo.png
Name[en_US]=APPLICATIONNAME
Exec=REALAPPLICATIONCOMMANDLINE
Path=APPLICATIONDIR
Comment[en_US]=COMMENT
Name=APPLICATIONNAME
Comment=COMMENT
Icon=gnome-panel-launcher

That part works fine.

But the terminal is still titled 'Terminal', and to differentiate it from the other terminals I have running I'd like to change the terminal's title.

I've found one way to do it, but it requires that you run the terminal command, thus

Exec=gnome-terminal --title APPNAME ...ArgsToRunRealApplication...

instead of the actual command you want to run.

I'm hoping that there's either a parameter, or another Key=Value pair that I just haven't found yet, to set the title, without using gnome-terminal directly to run the command.

I suppose I could write a script that would set the title, then run the application, but that's only a little better than using gnome-terminal.

Any suggestions?

1

Leave the Exec untouched and add those two lines on top of the script invoked by the XTERM:

test -x /usr/bin/xtitle || sudo apt-get install -y xtitle || exit 1
xtitle "My Title"
1
  • The Exec is not a script currently. I was hoping to avoid that. See last paragraph.
    – EdwinW
    Jan 4 '18 at 13:27
1

I neither know any solution that doesn't require a script. The following line in a script should work without installing anything new:

printf '\033]2;My Title\a'

See https://unix.stackexchange.com/a/358985 for explanation.

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.