Soo... I thought this would be a easy task. Create a .desktop file that launch my node.js app and thats it... Nope. My .desktop file looks like this:
[Desktop Entry]
Name=NodeJS App
Comment=My comment
Exec=lxterminal -t "NodeJS App" --working-directory=/path/to/app -e nameOfMyApp
Type=Application
Encoding=UTF-8
Terminal=true
Categories=None;
I also tried other ways to launch the app. I also tried out to launch my app with a python script. No chance. The Terminal stays empty and it does nothing.
It works fine when I open the terminal, go to the app folder and launch the app. What's wrong? Is there another way? The app runs on a raspberry pi with touchscreen as only way to control it. So it must be a solution where the user just need to open a file on the desktop.
Here is the solution. I installed node with the help of nvm. Using lxterminal like this will not add nvm as source. So the terminal can't find node or npm.
This command must be fired before I start a node app:
source ~/.nvm/nvm.sh