Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to create a bash script for the Dash home button, as I am trying to fully replace the Unity dock with the Cairo Dock. Unfortunately, I have been unable to make it so that the script only runs when I click on it.

How can I make a bash script execute when clicked upon?

If it helps, here is my code:


xdotool key Super
share|improve this question
It's #!/bin/bash not #/bin/bash. We all make mistakes! – It's Willem Jun 16 '15 at 22:23

The shebang is wrong, type this instead :


xdotool key Super

and set the execution bit on the script.

share|improve this answer
set the eXecution bit by opening Terminal and typing sudo chmod +x <path/to/bash_file.bsh> – SimplySimon Jun 15 '13 at 21:41

In Ubuntu 12.04, you should be able to do this simply by right-clicking the file, clicking properties in the drop-down menu, going to the permissions tab and checking the allow executing file as program button. If this does not work you can open a terminal and run this command:
sudo chmod +x /path/to/your/scriptfile. I hope I helped!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.