I created an .desktop file for my python app with my own application icon (32x32). The icon shows correct in the system menu, and on the task bar (Application Launch Bar). After starting the app, the icon shows in the task bar in Ubuntu, but on Raspberry Pi, the icon of the running app is replaced by some default terminal-like icon.
The .desktop file is in folder ~/.local/share/applications, and looks like this:
[Desktop Entry]
Name=Infrared Camera
Comment=Take photos with both the infrared and visible light camera
Icon=/home/roland/projects/pi_thermal_camera/icon.png
Exec=/home/roland/projects/pi_thermal_camera/IR_Photo_buttons.py
Type=Application
Encoding=UTF-8
Terminal=false
Categories=Other;
This is icon.png of 32x32 pixels:
This is the icon that is shown after starting the application:
Here is a screenshot of the task bar after starting the application:
The red and blue icon is a menu item on the task bar, and after clicking on it my Infrared app opens, and adds a terminal-like icon for the running app.
How can I get my nice own icon to show instead of that default icon when my app starts running?
I had the same problem and found the solution:
$ sudo chmod 644 /usr/share/icons/foobar.png
Icon=foobar
$ lxpanelctl restart
The same icon is now used in the application menu, the application launch bar and the list of open applications.