diff options
| author | Manuel Palenzuela <[email protected]> | 2019-06-30 01:01:26 +0200 |
|---|---|---|
| committer | Manuel Palenzuela <[email protected]> | 2019-06-30 01:01:26 +0200 |
| commit | 7198f2e2cc4cb2c01d0f4ac415e01537d0b05c3c (patch) | |
| tree | baa39b46d3fa26fae9c6cd86ff34509ab9525fb1 | |
| parent | Added check for gifview command (diff) | |
| download | smart-wallpaper-7198f2e2cc4cb2c01d0f4ac415e01537d0b05c3c.tar.gz smart-wallpaper-7198f2e2cc4cb2c01d0f4ac415e01537d0b05c3c.tar.bz2 smart-wallpaper-7198f2e2cc4cb2c01d0f4ac415e01537d0b05c3c.zip | |
Fixed day/night detection
| -rwxr-xr-x | smart-wallpaper | 9 |
1 files 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 |