Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Just like the title says, how do I launch a bash script in my ~/Downloads folder using a keyboard shortcut? I've tried binding cd ~/Downloads && ./bash-script.sh to different accelerators (ex. the "Tools" button or music player button on my keyboard, and F4) but no luck, yes the script is marked executable, I am trying to do this under "Custom Shortcuts" in System Settings -> Keyboard, and the command works in Terminal.

share|improve this question
    
have you tried binding '/home/Downloads/bash-script.sh' ? I'm assuming you have your #!/bin/bash as the first line? –  Matt Barnes May 15 '12 at 1:32

1 Answer 1

up vote 3 down vote accepted

I have a keyboard shortcut to launch a script to start conky for me.

Now it sounds like you have tried to 'all the right things'. In the command section of keyboard shortcuts I have: /home/karl/bin/start-conky.sh

If you have cd ~/Downloads && ./bash-script.sh in that field have you tried changing it to: /home/username/Downloads/bash-script.sh?

share|improve this answer
    
Thanks, that did it. I'm a little new to making my own scripts. @Matt No, my script starts with "cd ~/Downloads". Should it start with #!/bin/bash? It works regardless. –  Alucai Vivorvel May 15 '12 at 1:40

Your Answer

 
discard

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.