I’m using a zsh script to start conky and download and update wallpaper using wget and variety respectively. For some reason it is crashing on startup. It has a while loop.
The whole setup I’m using can be found here. It includes a startup script (which launches two other zsh scripts and is launched using an autostart.desktop file), a downloader script and an updater script (this one is failing).
This is the script in question. (edited to remove reference to some directories, may not work as it is below, but I’ve confirmed that it works when I run it from command line or Alt+F2)
#!/bin/zsh
cd $HOME/Pictures/Wallpapers
declare -i LAST
let LAST=0
declare -i LAST_TIME
let LAST_TIME=0
declare -i NEW_TIME
let NEW_TIME=1
while [ 1 ]; do
case "$(nmcli -g connectivity general)" in
full)
#echo "HTTP connectivity is up"
if (( LAST == 1 ))
then
NEW_TIME=$(stat -c %Y world_sunlight_map_rectangular.jpg)
if (( LAST_TIME == NEW_TIME ))
then
sleep 1
let LAST=1
else
let LAST=0
fi
else
#echo "Seting wallpaper"
variety --set=world_sunlight_map_rectangular.jpg
LAST_TIME=$(stat -c %Y world_sunlight_map_rectangular.jpg)
sleep 1
let LAST=1
fi
;;
limited)
#echo "Limited connectivity"
if (( LAST == 2 ))
then
sleep 1
else
#echo "Seting wallpaper"
variety --set=Sid@Home-Err.png
sleep 1
let LAST=2
fi
;;
none)
#echo "The network is down or very slow"
if (( LAST == 3 ))
then
sleep 1
else
#echo "Seting wallpaper"
variety --set=Sid@Home-NoErr.png
sleep 1
let LAST=3
fi
;;
esac
done
It runs once and then stops running. I think possible problems may be with autostart script (included below, edited to remove directory reference), or it may not be. Please help!
[Desktop Entry]
Type=Application
Name=Conky
Exec=$HOME/bin/conky.zsh
StartupNotify=false
Terminal=false
Icon=conky-logomark-violet
Categories=System;Monitor;