In General Linux , Jolicloud , Nerd Post , Ubuntu / Tags: arduino, Howto, Information, Linux, Software Help, Ubuntu, UNR /
I’ve showed how to create a launcher in the past (See: http://blog.hyperandy.com/2009/10/02/adding-a-shortcut-to-open-a-specific-vm-under-virtual-box-on-ubuntu/) so I won’t go into the nitty gritty of anything except the command syntax needed for the program to launch correctly.
Have you ever tried to create a luncher to a program (that you unziped “or untared” into a directory) or a script and noticed the launcher you created did not work but launching the program from the command line worked? Typically you either get nothing at all or just a flash of white and then the desktop and you start scratching your head as to what happened.
For a basic script the easiest way to fix this is and first thing to try when creating the launcher (Fig.1) to a script:
In the “Type:” field Select “Application in Terminal” enter anything descriptive into the “Name:” field and then you can either type your path or use the “Browse…” Button to find the path to your *.sh file.

Fig. 1 – Example of ‘Create Launcher’ window
If setting the Type to Application in Terminal did not work then you will need to invoke bash. Below is an example I used to create a shortcut to the Arduino programming interface. I am aware I can also create a PATH but this works much better for my uses.
When you download the Arduino IDE from http://arduino.cc/en/Main/Software it comes in a *.tgz package (NOTE: this is not help on installing, just info on creating the shortcut, please see install help for Arduino on linux @ arduino.cc).
I extracted the *.tgz package to my home directory and can launch the program whenever I wish from the command line by going into the directory and typing:
./arduino
But as you can see this is highly inconvenient. To correct this (and this method works for scripts as well) when creating a launcher for “Type:” I choose “Application“. I don’t choose “Application in Terminal” in this instance, because I only want to the program to run and I don’t want to leave the terminal open the entire time I am working (if you close the terminal that is opened up, it will close the program as well). For “Name:” I set this as Arduino, that’s pretty descriptive. :) next is “Command:“ the important part that must be right. In the input area I type:
bash -c "cd /home/hyperandy/Downloads/arduino-0017/ ; ./arduino"
Also instead of “;” you can also use the common “&&”. The typical short cut to home “~” also works just fine. So the following command would work fine too:
bash -c "cd ~/Downloads/arduino-0017/ && ./arduino"
It’s fairly straight forward, the bash and sh command interpreters work interchangeably here. The -c allows it to interpret the commands as a string instead of from the standard input the cd is quite obviously the change directory command to the directory holding your program and/or your script the ; and && basically say, when done with X do X.
I Imagine this will work on most distributions out there, but I have only used it with Ubuntu, Jolicloud, and Mint (both of the latter, derivatives of Ubuntu). Please feel free to share this information if you find it useful. If you have any additions or corrections please let me know.
1 ResponsesLeave a comment ?
It’s work for me!
Thanks