about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYour Name <you@example.com>2021-11-20 17:42:43 +0000
committerYour Name <you@example.com>2021-11-20 17:42:43 +0000
commit70c8fc200307e5f8e6373c00db6471d509d8d8ed (patch)
tree4bcab00c5d923b3c5d639e838a163a50a6dc8ac1
parentAdding support for wallpapers being drawn on top of the xorg root window (diff)
downloadsmart-wallpaper-70c8fc200307e5f8e6373c00db6471d509d8d8ed.tar.gz
smart-wallpaper-70c8fc200307e5f8e6373c00db6471d509d8d8ed.tar.bz2
smart-wallpaper-70c8fc200307e5f8e6373c00db6471d509d8d8ed.zip
Dont animate with display
-rwxr-xr-xsmart-wallpaper5
1 files changed, 3 insertions, 2 deletions
diff --git a/smart-wallpaper b/smart-wallpaper
index addc481..00629a4 100755
--- a/smart-wallpaper
+++ b/smart-wallpaper
@@ -27,6 +27,7 @@ cleanup() {
     kill $procid
   fi
   killall gifview #TODO: gotta kill mpv as well (but not all instances) HELP NEEDED
+  killall display
   xsetroot -solid black
 }
 
@@ -48,6 +49,7 @@ set_wallpaper() {
     kill $procid
   fi
 
+  killall display
   killall gifview #TODO: gotta kill mpv as well (but not all instances) HELP NEEDED
 
     if [ -f /usr/bin/gifview ] && [[ $1 == *".gif" ]]; then
@@ -58,8 +60,7 @@ set_wallpaper() {
       nice xwinwrap -ni -ov -ni -s -nf -un -argb -g $resolution -- nice mpv --fullscreen --on-all-workspaces --no-config --no-input-default-bindings --no-stop-screensaver --loop-file --no-audio --no-osc --no-osd-bar -wid WID --quiet $1 &
       procid=$!
     else
-      echo $1 > /tmp/smart-wallpaper-current-image    
-      nice xwinwrap -fs -st -sp -nf -ov -s -r -debug -- nice sh -c 'display -window $0 $(cat /tmp/smart-wallpaper-current-image);sleep infinity' WID &
+      nice xwinwrap -fs -st -sp -nf -ov -s -r -debug -- nice sh -c 'display -flatten -window $0 -resize '$resolution' '$1';sleep infinity' WID &
       procid=$!
     fi