Integrate terminal applications with Terminal=true in their desktop entry file
A desktop entry can contain a Terminal=true
statement that instructs the launcher to start the application in a terminal.
This can be really useful to declare terminal applications like vim, emacs, irssi, mutt and the like in the desktop environment. Unfortunately, once started, the terminal window is not associated with the desktop application in the application switcher and shell dock.
It's easy to associate the terminal window with the correct desktop icon in the app switcher and dock by specifying a specific WMClass attribute to the started window. In gnome-terminal this can be achieved by running a specific gnome-terminal-server instance like described in:
- https://chrisirwin.ca/posts/multiple-instances-of-gnome-terminal/
- https://wiki.gnome.org/Apps/Terminal/Debugging
Example of desktop file entry:
[Desktop Entry]
Comment=
Terminal=false
Name=irssi
Exec=/bin/sh -c '$(env PATH="/usr/libexec:/usr/lib/gnome-terminal:$PATH" which gnome-terminal-server) --app-id=fr.mildred.irssi --class=fr.mildred.irssi --name=fr.mildred.irssi & sleep 0.25; gnome-terminal --app-id=fr.mildred.irssi --hide-menubar -e "flatpak run fr.mildred.irssi" '
Categories=Network
Keywords=irssi,irc
StartupWMClass=fr.mildred.irssi
Type=Application
Icon=fr.mildred.irssi
Version=1.0
See also: gnome-terminal#46 (closed)
Edited by Mildred