I have created different scripts that I successfully used under Lubuntu/Lxde, including some made to be run by keyboard shortcut that would start firefox and search selected text on the internet.
For example, this script, if associated with a shortcut, should search selected text in google:
#! bin/sh
sh -c 'firefox "https://www.google.com/search?q='$'(xclip -o)"'
One to translate French to English:
#! bin/sh
sh -c 'firefox "http://translate.google.com/#fr/en/$(xclip -o)"'
and so on
But in Mint/Xfce, cannot add these scripts to be run by shortcut in Settings/Keyboard/Application Shortcuts: I get an error similar to this:
enter image description here
I think some applications have to be installed to run this. But after installing xclip and git it still doesn't work.
1 Answer 1
As requested, I am posting my comment as an answer.
It looks like you have a bad shebang line. Try
#!/bin/bash
instead of
#! bin/bash
The space should not be an issue, the / before bash, however, is essential.
#!/bin/sh. Also,please show the output ofls -l /home/cipricus/Documents/scripts/firefox/search-google.sh.$ ls -l /home/cipricus/Documents/scripts/firefox/search-google.sh -rwxrwxr-x 1 cipricus cipricus 75 Nov 29 20:09 /home/cipricus/Documents/scripts/firefox/search-google.sh. the form of the script works fine, maybe something wrong with my copy/paste here?!and/? i just open my otherwise working scripts and pasted here/. In your question you have it as#! bin/bashinstead of#!/bin/bash