From 7198f2e2cc4cb2c01d0f4ac415e01537d0b05c3c Mon Sep 17 00:00:00 2001 From: Manuel Palenzuela Date: Sun, 30 Jun 2019 01:01:26 +0200 Subject: Fixed day/night detection --- smart-wallpaper | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/smart-wallpaper b/smart-wallpaper index 5b2bdc5..e5dfac7 100755 --- a/smart-wallpaper +++ b/smart-wallpaper @@ -19,6 +19,7 @@ set_wallpaper() { if [[ $1 == *".gif" ]] && [ -f /usr/bin/gifview ]; then gifview --animate -w root $1 else + #killall gifview# every 500h secs its settings the wallpaper but is it necessary (check if gifview proc?) feh --bg-fill $1 fi } @@ -58,18 +59,22 @@ do if [ "$location" != "" ]; then string=$(redshift -l $location -p) - if [[ $string == *"Daytime"* ]]; then + shopt -s nocasematch + if [[ $string == *"day"* ]]; then set_wallpaper "$daytimewallpaper" else set_wallpaper "$nighttimewallpaper" fi + shopt -u nocasematch else string=$(redshift -p) - if [[ $string == *"Daytime"* ]]; then + shopt -s nocasematch + if [[ $string == *"day"* ]]; then set_wallpaper "$daytimewallpaper" else set_wallpaper "$nighttimewallpaper" fi + shopt -u nocasematch fi sleep 500s -- cgit 1.4.1