1

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:

enter image description here

Likewise, when I press the super key and start typing "sao..." I see the SAOimage icon, and it starts SAOimage.

enter image description here

But once the programs are running, when I ALT+TAB between applications, Arduino is represented by the SAOimage icon, and SAOimage has no icon!

enter image description here

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...?

OZ1SEJ
  • 1,235
  • 3
  • 19
  • 31
  • What do you plan to do when newer version of Arduino will be released? – N0rbert Apr 25 '21 at 11:06
  • 1
    Does this answer your question? How to install the latest Arduino IDE? Use Ubuntu Make, it will install the application with icon and system integration for you automagically. – N0rbert Apr 25 '21 at 11:06
  • @N0rbert Usually I just unpack and overwrite the old files in the program folder. The link you provided opened my eyes to the fact that I hadn't run the install.sh which indeed installed the icon! Thank you! ...but it still displays the SAOimage icon when I alt-tab... – OZ1SEJ Apr 26 '21 at 19:06

1 Answers1

1

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.

Levente
  • 3,961
  • A-mazing! That's it! I have no idea what "StartupWMClass" is, I just copied another desktop file. (SAOimage still shows no icon when I alt-tab it, but at least Arduino show the Arduino icon now.) Thanks! – OZ1SEJ Apr 26 '21 at 19:23