I have the following desktop entry on my ~/.local/share/applications
directory:
[Desktop Entry]
Type=Application
Version=1.0
Name=FetchSecurity
Exec="/home/user/Pictures/security/fetchSecurityCam.sh"
Terminal=false
And the following script:
#!/bin/sh
check=`echo "$1" | grep -E ^\-?[0-9]+$`
if [[ $# -eq 0 ]] ; then
interval=300
elif [[ $check == '' ]] ; then
echo "Not a number argument" $1
exit
else
interval = $1
fi
export OUTPUT=~/Pictures/security
watch -n $interval 'wget -O "$OUTPUT/cam_$(date +%F-%T).jpg" [MY SECURITY CAM IP] --user-agent="Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"' &> /dev/null &
The entry appears in Gnome apps but it doesn't run the script, what am I doing wrong?
The script works if it's run fromt a terminal.
Terminal=false
option totrue
, add a sufficiently longsleep
before theexit
and you will see error message "Not a number argument"Exec="xterm -hold -e /home/user/Pictures/security/fetchSecurityCam.sh"