jwatte
Posts: 203
Joined: Sat Aug 13, 2011 7:28 pm

My .desktop file doesn't work in autostart

Sun Aug 03, 2014 6:23 am

I have created a .desktop file for a simple utility I wrote in python2 and pygame.
When I start the utility from the command line, it works great.
When I start the utility by double-clicking the .desktop file, it works great.
However, when the system auto-starts, I can see the desktop load, see the window of my utility temporarily show up, and then it dies.

I have a second .desktop link in the autostart folder, to lxterminal.desktop, and this starts fine. (It did so even when it was the only autostart .desktop file.)

I have looked for log files in /var/log and /home/pi, but I have not found anything that mentions the voltmon.desktop file, or the reason why it may be crashing.
I'm looking first of all for help on where to find these log files, and barring that, how to diagnose this problem. If someone knows exactly what the problem is, I'd take a direct solution, too.

Here is the .desktop file:

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Name=VoltageMonitor
GenericName=VoltageMonitor
Comment=Show how much juice is in the battery
Path=/usr/local/src/voltmon/
Exec=python /usr/local/src/voltmon/test1.py
Icon=/usr/local/src/voltmon/battery.png
Type=Application
Categories=Utility,Programming
Also of curiosity: I've put this file in .local/applications/ (I had to create that direction) but it doesn't show up in the applications menu.

jwatte
Posts: 203
Joined: Sat Aug 13, 2011 7:28 pm

Re: My .desktop file doesn't work in autostart

Tue Aug 05, 2014 12:00 am

Where do you think I could ask this question about why my .desktop auto-started program crashes, while it works fine when normally starting or double-clicking, and how to debug the cause of this problem?

jwatte
Posts: 203
Joined: Sat Aug 13, 2011 7:28 pm

Re: My .desktop file doesn't work in autostart

Thu Aug 07, 2014 1:24 am

I had to track this down all on my lonesome.
In case anyone else has the same problem: I got the app to start and stay started by adding "StartupNotify=false" to the .desktop file.

Return to “Troubleshooting”