about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-06-29 16:19:55 +0200
committerManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-06-29 16:19:55 +0200
commit32aee15781f6cec4a1fd7ee45a5f2f535c680ca1 (patch)
tree2ae0ab84b00d65ecdb604b838f70256db8ee0029
parentFixed a bug that prevented the script from exiting (diff)
downloadsmart-wallpaper-32aee15781f6cec4a1fd7ee45a5f2f535c680ca1.tar.gz
smart-wallpaper-32aee15781f6cec4a1fd7ee45a5f2f535c680ca1.tar.bz2
smart-wallpaper-32aee15781f6cec4a1fd7ee45a5f2f535c680ca1.zip
Rewrite of the change wallpaper function (thinking of adding gif support
-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