I'm streaming

Ubuntu desktop icon to launch scripts

If you would like to launch a script, or a collection of scripts from a desktop icon on ubuntu.

from ~/Desktop create a file with the extension of .desktop in my case I made start.desktop


[Desktop Entry]
Comment=Lorem Script

For more options you can check them out here

Now that we have that running, this will run the start script on when it opens. If you wish to see terminal output you can change Terminal=true. One thing I noticed is that if you wish to have a script running and stay open, make sure that not all of the scripts end with the command to put them in the background. In my case I ran a script that was an angular application with a chromium browser opening up ( to be a kiosk ). I had to make sure that the chromium browser was a script that didn’t exit in order for it to work.




# run kiosk
/home/jon/.nvm/versions/node/v9.4.0/bin/node /home/jon/Development/my-project/client.js &

sleep 10
# run web server
/home/jon/.nvm/versions/node/v9.4.0/bin/npm start --prefix /home/jon/Development/my-project/app &

sleep 15
chromium-browser http://localhost:8080 --kiosk

The sleeps in this context will make sure that it is running properly and the chromium-browser does not run without giving an ample amount of time for the npm start to finish. Make sure to check your applications you wish to run ( node, npm ) with which node to figure out the proper running path directory to make sure it works as intended if you wish to run it as a different user.

An inventive, entrepreneurial and positively unsatisfied mind that constantly pushes the tech boundaries to create new solutions and devices that change people’s lives.

One Comment
  1. Reply Running .desktop application on boot - Jon Hemstreet January 27, 2018 at 1:16 pm

    […] will be using the same .desktop app we made in this post. The goal is to have it run on boot when the user logs into the desktop gui rather than having to […]

Leave a Reply