2

Is there a way to set a title to a terminal that is opend via desktop shortcut?

The perfect solution would be if the [Desktop Entry] Name=myTitle could be displayed in the title. Does anyone know if this is possible?

See also (approach here didn't work): desktop shortcut to terminal-app of another user possible?

based on this: Can no longer set terminal title in Ubuntu 16 (gnome-terminal)

ssssstut
  • 939

2 Answers2

0

Simplest solution I can think of based on my previous answers, would be to spawn terminal with command that sets title + spawns interactive shell of your choice. Specifically, I would make the Exec= part of the .desktop file as so:

Exec=gnome-terminal -e "bash -c 'printf \"\033]0;TEST1\007\";bash'"
0

Use

Exec=gnome-terminal -t myTitle -e myCommand ...

in your desktop file. See also the gnome-terminal help output:

$ gnome-terminal --help-terminal-options
Usage:
  gnome-terminal [OPTION…] [-- COMMAND …]

Terminal options; if used before the first --window or --tab argument, sets the default for all terminals:
  -e, --command                   Execute the argument to this option inside the terminal
  --profile=PROFILE-NAME          Use the given profile instead of the default profile
  -t, --title=TITLE               Set the initial terminal title
  --working-directory=DIRNAME     Set the working directory
  --wait                          Wait until the child exits
  --fd=FD                         Forward file descriptor
  --zoom=ZOOM                     Set the terminal’s zoom factor (1.0 = normal size)