mirror of
https://github.com/chenasraf/BitDay-Linux.git
synced 2026-05-17 17:58:04 +00:00
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:
10
update.sh
10
update.sh
@@ -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]}"
|
||||
|
||||
Reference in New Issue
Block a user