I have an executable file that are generated from a python program by using auto-py-to-exe, a gui front for pyinstaller, and a .ico file for a 64x64 icon, both placed in /home/pi/TestAS/Program. The program uses the path to store some persistent data.
Both in /home/pi/.config/autostart and in /home/pi/Desktop I have placed a file named TestAS.desktop with the content:
[Desktop Entry]
Comment=Testing Auto Start
Exec=/home/pi/TestAS/Program/TestAS
Icon=/home/pi/TestAS/Program/TestAS.ico
Path=/home/pi/TestAS/Program
Terminal=false
Encoding=UTF-8
Type=Application
Categories=None;
Name[en_US]=TestAS
When I reboot the Pi, it starts the program, but it does not show the correct icon in the task bar (it shows the anonymous icon instead) and it places the persistent data out in /home/pi.
When I start the program by double clicking the icon on the desktop, it shows the correct icon in the task bar and places the persistent data in the correct directory.
Are there any of you good people who have ideas to get autostart to behave properly?
On Raspberry Pi, Autostart of executable does not show the correct icon and path
Re: On Raspberry Pi, Autostart of executable does not show the correct icon and path
The first one is the correct location for autostart.
That icon has nothing to do with the Icon defined in the desktop file, sorry.When I reboot the Pi, it starts the program, but it does not show the correct icon in the task bar
You should check your application if ti can define a different icon.
I'm not so sure about the other values in your .desktop file; Have a look-see here:it places the persistent data out in /home/pi.
https://specifications.freedesktop.org/ ... atest.html
OK, Path seems to be correct, but it's up to the application to honour that.
Re: On Raspberry Pi, Autostart of executable does not show the correct icon and path
Thank you for your answer.
The point is that the "shortcut" (the .desktop file) works differently if it is placed on the desktop and double clicked, or it is in the autostart directory and started at boot up.
In the Desktop Entry Specification you refer to, Icon is "Icon to display in file manager, menus, etc.", I read "etc." as also being the icon shown in the task bar, and it works when started from the desktop.
In the same document Path is "If entry is of type Application, the working directory to run the program in". This also works when started from the desktop.
BR Søren
The point is that the "shortcut" (the .desktop file) works differently if it is placed on the desktop and double clicked, or it is in the autostart directory and started at boot up.
In the Desktop Entry Specification you refer to, Icon is "Icon to display in file manager, menus, etc.", I read "etc." as also being the icon shown in the task bar, and it works when started from the desktop.
In the same document Path is "If entry is of type Application, the working directory to run the program in". This also works when started from the desktop.
BR Søren