about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xsmart-wallpaper32
1 files changed, 32 insertions, 0 deletions
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