I downloaded the Arduino IDE v. 1.8.13 for Linux 64-bit. It's a zipped archive, which you unzip and run the binary. In order to have it easily accessible, I created a .desktop
file in ~/.local/share/applications/
called arduino.desktop
:
$ cat arduino.desktop
[Desktop Entry]
Type=Application
Name=Arduino IDE
GenericName=Arduino IDE
Comment=Open-source electronics prototyping platform
Exec=/home/steen/Programmer/Arduino/arduino
Icon=/home/steen/.local/share/applications/arduino2.png
Terminal=false
Categories=Development;IDE;Electronics;
MimeType=text/x-arduino;
Keywords=embedded electronics;electronics;avr;microcontroller;
StartupWMClass=processing-app-Base
In order to have the Arduino logo displayed, I downloaded a PNG called arduino2.png
and put it in the same folder, and referenced the above file to it, as you can see.
At approximately the same time, I also downloaded a program called SAOimage for astronomical imaging. I also had to create a .desktop
file for this program:
$ cat saoimage.desktop
[Desktop Entry]
Type=Application
Name=SAOImage DS9
GenericName=SAOImage DS9
Comment=Astronomical Fits File Editor
Exec=/home/steen/Programmer/SAOImage/ds9
Icon=/home/steen/Programmer/SAOImage/saoimage.png
Terminal=false
Categories=Graphics
MimeType=image/svg+xml;
Keywords=
StartupWMClass=processing-app-Base
Here, the icon file is in the same folder as the program. Now, when I press the super key and start typing "ard..." I see the Arduino icon, and it starts Arduino:
Likewise, when I press the super key and start typing "sao..." I see the SAOimage icon, and it starts SAOimage.
But once the programs are running, when I ALT+TAB between applications, Arduino is represented by the SAOimage icon, and SAOimage has no icon!
Also, if I first start SAOimage and then Arduino, they start in that order. But if I start Arduino first, and then press super key, type sao and start SAOimage, the program doesn't start; instead focus is just shifted to Arduino.
Why is this? Have I done something wrong? Is there some mechanism I don't understand? As far as I can see there is no reason - based on the .desktop files - that Ubuntu confuses the two...?
I bet it has to do with the
StartupWMClass
, the last line of both desktop files; specifically, the confusion stems from how their values are identical.From this post we can see that
StartupWMClass
is used to describe what application is responsible for a window (in case an application is creating several different kind of windows).Now if you have two separate applications in your scenario, you possibly don't even need the
StartupWMClass
declaration; or at least, definitely not with identical values in both desktop files.