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: