I try to execute a bash script from a shortcut set from the settings (system settings > keyboard > shortcuts
or analogous), but it doesn't execute, although it works just fine from the terminal...
The script is as following :
#!/bin/bash
#"$1" should be a number from 0 to 5
if [ "$#" == 0 ]; then
echo "Ce programme nécessite en argument le nombre d'étoiles (de 0 à 5) à attribuer à la chanson qui est en train de tourner dans Rhythmbox."
exit
fi
rhythmbox-client --set-rating $1
notify-send "$1 étoiles" "$(rhythmbox-client --print-playing)" --expire-time=1000 --icon=starred
Then I set the shortcut, but it doesn't work (Noting happens). As said before, the same code executed from the terminal works great...
Thanks for helping me !!
The command defined in the pertinent field was missing the file interpreter (in this case:
bash
), and should have been using the files' absolute path.Ergo:
bash /home/username/Scripts/rhythmbox-set-stars.sh 5
A restart of the utility/session was required to apply the new values, presumably because values for the session were updated from the modified
.gconf
file.