Fix for ArchLinux+MATE

For some reason, Arch+MATE reports MATE (all uppercase) as XDG_CURRENT_DESKTOP. Also, MATE uses picture-filename instead of picture-uri and doesn't seem to like the "file://" prefix. Fixed all these.
This commit is contained in:
nariox
2017-07-20 12:25:48 -04:00
committed by GitHub
parent 55ab958a48
commit 9950fc38ac

View File

@@ -33,8 +33,9 @@ hour=$(echo $hour | sed 's/^0*//')
# Different desktop environment implementations
case $XDG_CURRENT_DESKTOP in
Mint|Mate) setcmd="gsettings set org.mate.background picture-uri";;
Cinnamon) setcmd="gsettings set org.cinnamon.background picture-uri";;
*) setcmd="gsettings set org.gnome.desktop.background picture-uri";; # GNOME/Unity, default
MATE) setcmd="gsettings set org.mate.background picture-filename ";;
Cinnamon) setcmd="gsettings set org.cinnamon.background picture-uri file://";;
*) setcmd="gsettings set org.gnome.desktop.background picture-uri file://";; # GNOME/Unity, default
esac
if [[ -z $XDG_CURRENT_DESKTOP ]]; then # Fallback for i3
case $DESKTOP_SESSION in
@@ -44,12 +45,13 @@ fi
for i in ${!timing[@]}; do # Loop through the wallpapers
if [ ${timing[$i]} -gt $hour ]; then
$setcmd file://$DIR/${files[i-1]}
$setcmd $DIR/${files[i-1]}
echo "Wallpaper set to ${files[i-1]}"
exit
fi
done
# Fallback at last wallpaper if time is not relevant
$setcmd file://$DIR/${files[7]}
$setcmd $DIR/${files[7]}
echo $setcmd
echo "Wallpaper set to ${files[7]}"