From deae590790ed03577906334c2238a339bcd0411d Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 20 Nov 2021 17:17:13 +0000 Subject: Adding support for wallpapers being drawn on top of the xorg root window Now you need xwinwrap (to createa window on top of the root) And you need imagemagick, to draw the image to the window created by xwinwrap --- README.md | 3 ++- smart-wallpaper | 16 ++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 65a2f33..5e2eb0a 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ You can either clone the repository and run the script or if you are running Arc ### Dependencies Required: redshift - determining if its day/night in your location. - feh - setting the wallpaper. + imagemagick - setting the wallpaper. + xwinwrap - drawing on top of the Xorg root bash Optional: gifsicle - animated wallpaper support diff --git a/smart-wallpaper b/smart-wallpaper index 4e551a0..addc481 100755 --- a/smart-wallpaper +++ b/smart-wallpaper @@ -50,7 +50,6 @@ set_wallpaper() { killall gifview #TODO: gotta kill mpv as well (but not all instances) HELP NEEDED - if [ -f /usr/bin/xwinwrap ]; then if [ -f /usr/bin/gifview ] && [[ $1 == *".gif" ]]; then echo "gifsicle --resize $resolution $delay_flag \$1 | gifview --animate -w \$2" > /tmp/smart-wallpaper-gifcmd nice xwinwrap -ov -ni -s -nf -un -argb -g $resolution -- nice sh /tmp/smart-wallpaper-gifcmd $1 WID & @@ -59,21 +58,10 @@ 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 - feh --no-fehbg --bg-fill $1 - procid='' - fi - else - if [ -f /usr/bin/gifview ] && [[ $1 == *".gif" ]]; then - nice gifsicle --resize $resolution $1 $delay_flag | nice gifview --animate -w root & + 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 & procid=$! - elif [ -f /usr/bin/mpv ] && [[ $1 == *".mp4" ]] || [[ $1 == *".mov" ]] || [[ $1 == *".avi" ]] || [[ $1 == *".mkv" ]]; then - 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 0 --quiet $1 & - procid=$! - else - feh --no-fehbg --bg-fill $1 - procid='' fi - fi } -- cgit 1.4.1