File *.desktop in applications menu

The standard panel of LXDE - http://wiki.lxde.org/en/LXPanel
Locked
giomba
Posts: 1
Joined: Tue Aug 13, 2013 5:06 pm

File *.desktop in applications menu

Post by giomba »

I have developed a simple program which runs from a single directory, and it expects to find some files in the current directory.
To launch it, I have created a .desktop file and I set the "Path" variable to the /opt/program directory where the executable and the other needed files are installed.
It works fine with GNOME, XFCE, KDE and other desktop environments, but LXDE seems to ignore that variable and does not change the working dir before executing the program, so it can not work.
I noticed that if I double click the icon browsing the /usr/share/applications folder, the link works; but if I click it inside the LXDE Applications menu, it does not work and my programs claims it can not find the files.

Is this a LXDE bug I haven't noticed? Is my .desktop file wrong? How can I solve? Here is the code (that works with all the other windows manager):

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=PPong
Name[it_IT]=PPong
Exec=/opt/ppong/ppong
Icon=/opt/ppong/data/icon.png
Comment[it_IT]=Gioco ispirato ad Arkanoid
Path=/opt/ppong
Categories=Game;
Sorry for bad English, I'm italian and this is my first post in this forum!
Thanks in advance! :)
drooly
Posts: 791
Joined: Mon Apr 08, 2013 6:45 am

Re: File *.desktop in applications menu

Post by drooly »

hello!
this is definitely not a bug; rather a lack of feature.

here on my archlinux install, i just had a look at 10+ files in /usr/share/applications, none has a "Path="... hmmm...

anyhow, you can solve this by wrapping your program in a shell script, say ~/bin/startppong

Code: Select all

#!/bin/bash
cd /opt/ppong
./ppong
cd
and call that from your .desktop file.
that said, there might be other - better - solutions.
Locked