From 3db5b1dac4411ce7587ab012ffa3d8fc41be3479 Mon Sep 17 00:00:00 2001 From: Manuel Palenzuela Date: Fri, 28 Jun 2019 18:11:51 +0200 Subject: Initial Release --- smart-wallpaper | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 smart-wallpaper diff --git a/smart-wallpaper b/smart-wallpaper new file mode 100755 index 0000000..2815408 --- /dev/null +++ b/smart-wallpaper @@ -0,0 +1,32 @@ +#!/bin/bash + +daytimewallpaper=~/Images/wave.jpg +nightimewallpaper=~/Images/city.jpg + +while true +do + + if [ -f /usr/share/geolocate/.location ]; then + string=$(redshift -l $(cat /usr/share/geolocate/.location) -p) + if [[ $string == *"Daytime"* ]]; then + feh --randomize --bg-fill $daytimewallpaper + echo "geolocate found. DAYTIME" + else + feh --randomize --bg-fill $nightimewallpaper + echo "geolocate found. NIGHTTIME" + fi + else + string=$(redshift -p) + if [[ $string == *"Daytime"* ]]; then + feh --randomize --bg-fill $daytimewallpaper + echo "geolocate NOT found. DAYTIME" + else + feh --randomize --bg-fill $nightimewallpaper + echo "geolocate NOT found. NIGHTTIME" + fi + fi + + sleep 500 +done + +#DO TRANSITION SMOOTH -- cgit 1.4.1