about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xsmart-wallpaper15
1 files changed, 11 insertions, 4 deletions
diff --git a/smart-wallpaper b/smart-wallpaper
index c96e166..ded197a 100755
--- a/smart-wallpaper
+++ b/smart-wallpaper
@@ -15,6 +15,13 @@ print_usage() {
   echo "    [-h]: OPTIONAL : print help message"
 }
 
+set_wallpaper() {
+  #if [[ $1 == *".gif" ]]; then
+  #  mplayer
+  #else
+    feh --bg-fill $1
+}
+
 if (( $# == 0 )); then
     print_usage
     exit 1
@@ -51,16 +58,16 @@ do
   if [ "$location" != "" ]; then
     string=$(redshift -l $location -p)
     if [[ $string == *"Daytime"* ]]; then
-      feh --bg-fill $daytimewallpaper
+      set_wallpaper "$daytimewallpaper"
     else
-      feh --bg-fill $nighttimewallpaper
+      set_wallpaper "$nighttimewallpaper"
     fi
   else
     string=$(redshift -p)
     if [[ $string == *"Daytime"* ]]; then
-      feh --bg-fill $daytimewallpaper
+      set_wallpaper "$daytimewallpaper"
     else
-      feh --bg-fill $nighttimewallpaper
+      set_wallpaper "$nighttimewallpaper"
     fi
   fi