I have recently switched my default desktop environment to Ubuntu Gnome as part of our ongoing dogfooding program. First impressions are good. As always different is confusing and I keep hitting buttons that used to do one thing and get another; 5 years with one desktop will do that to a man.
As a consummate command-line junkie I really use my desktop environment to hold my terminal windows, lots of them. It is really important my desktop environment will sensibly collate them; sensibly to me. I use a lot of command line tools for email, IRC etc. Those are necessarily hosted in terminal windows but not semantically terminal windows. I want them to be grouped together away from actual terminals and preferably they should have my preferred icons.
I am pleased to say I have been able to persuade Gnome of my predilections. It has been a long and frustrating journey. I have to thank Laney for his support in this endeavour, for answering interminable IRC questions and stopping me from sticking a fist through my screen.
gnome-terminal --class weechat -- weechatOf course nothing is ever simple. gnome-terminal is now smart, starting a server which spawns new windows for you thus defeating the window manager class option. After some playing and a lot of whining at people further down the road they pointed me to the --app-id option allowing me to separate instances by use case with a server for each. After some work (and getting a bug fixed in the Ubuntu gnome-terminal wrapper) I was able to use those two in combination:
gnome-terminal --app-id com.example.Terminal.weechatNow my windows are separated and grouped in the alt-TAB popup. Sadly they are all called gnome-terminal.
--class weechat -- weechat
[Desktop Entry]Note that you want the Name= attribute to be unique in space and time otherwise it will associate your windows with another application (likely with the same icon) but not with your command and generally make your head hurt. This had me going for an hour as one of my groups was fine (the name happened to be unique) and the other not.
Encoding=UTF-8
Name=my-weechat
Comment=Chat with other people using Internet Relay Chat
Exec=gnome-terminal --app-id org.shadowen.Terminal.my-weechat --class my-weechat --hide-menubar --title Weechat
Icon=weechat
Terminal=false
Type=Application
This file tells the launcher which icon to associate with this application. You need to drop that into your personal applications directory ($HOME/.local/share/applications) for Gnome to know about it. Now you can start this new application from the overview search box. You can also drag that icon from the searcher to the Gnome Dash to have it clickable. Nice. Now I have my windows grouped on alt-TAB with the specified name underneath and the appropriate icon. Win!
This seemed to work for a while, until it stopped working and they all went back to being named gnome-terminal and using the original Terminal icon in alt-TAB. Arrgggh.
StartupNotify=trueWith these set to match the class used by gnome-terminal the Gnome Launcher was able to reliably associate the new windows with the appropriate icon but in the Gnome Dash and in the alt-TAB window.
StartupWMClass=my-weechat
[Desktop Entry]
Encoding=UTF-8
Name=my-weechat
Comment=Chat with other people using Internet Relay Chat
Exec=gnome-terminal --app-id org.shadowen.Terminal.my-weechat --class my-weechat --hide-menubar --title Weechat
Icon=weechat
Terminal=false
Type=Application
StartupNotify=true
StartupWMClass=my-weechat