2
1
I have a home made script that takes a screenshot and uploads it to puush, and I have put the script in /usr/bin. If I open a terminal and write the name of the script it runs perfectly. I use Debian Unstable(Sid) with Gnome3.
What I am trying to do is to put the script on a keyboard shortcut or at least run it without open a terminal. I have tried to use the Alt+F2 to open a command prompt, but of some reason my script doesn't run even if I try to invoke it that way. Same thing if I put the script to a keyboard shortcut.
I have also looked at the permissions for the file, and everyone is allowed to read or run the script, and it's owned by root and is in the root group, just like other programs.
The goal is to run the homemade script using a keyboard shortcut, and using command prompt as a secondary option if keyboard shortcut doesn't work. I am stumped on what to do though.
Things tested so far:
Using whole path to run the script.
Open gnome-terminal and pass the script as a parameter "gnome-terminal -e script"
add #!/bin/bash in beginning of script
Does your script have a shebang? – FSMaxB – 2013-09-18T07:32:12.953
Btw, you really should change the title of your question, because you know how to make a keyboard shortcut and the title makes one think you don't! – FSMaxB – 2013-09-18T07:55:09.517
@FSMaxB What is a shebang? Any suggestions for a better title? – Wertilq – 2013-09-18T12:38:30.187
A shebang is the '#!/bin/whatever-shell' at the beginning of the script. Have you tried calling the script by it's full path (/usr/bin/script) instead of just it's name? As to the title: for example "GNOME3 keyboard shortcut doesn't run script". – FSMaxB – 2013-09-18T16:06:22.260
@FSMaxB I have a feeling it DOES find the script, since it just immediately closes down the ALT+F2 prompt when I type it right. If I type wrong name of script, it says there is no such file. What shebang should I put in beginning of the script? – Wertilq – 2013-09-19T11:34:34.823
Normally the shebang is #!/bin/sh if it is a shell script, if it's python for example, it would most likely be #!/usr/bin/python . You should really try running it by the full path instead of just it's name and therefore relying on the PATH variable. – FSMaxB – 2013-09-19T14:34:59.403
@FSMaxB I tried running with full path, and that did not work, I will try with #!/bin/sh tomorrow. – Wertilq – 2013-09-19T15:13:48.077
@FSMaxB it have a #!/bin/bash – Wertilq – 2013-09-20T14:24:03.960
Then I have no further suggestions on what to do! – FSMaxB – 2013-09-20T18:10:18.353
@FSMaxB well I got it working, see my own answer to the question. – Wertilq – 2013-09-20T19:32:01.627