about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2022-09-15 16:03:45 +0200
committerBaitinq <manuelpalenzuelamerino@gmail.com>2022-09-15 16:03:45 +0200
commita23e6ed658342a405544ebe055ec1ac2fd464484 (patch)
treea35a0b10f4e90bd2d1beac29b6e0e3768ae1adf2
parentCreate LICENSE (diff)
downloadsmart-wallpaper-master.tar.gz
smart-wallpaper-master.tar.bz2
smart-wallpaper-master.zip
Basic wayland (swaybg) support HEAD master
-rwxr-xr-xsmart-wallpaper7
1 files changed, 5 insertions, 2 deletions
diff --git a/smart-wallpaper b/smart-wallpaper
index 5748f64..4951ad6 100755
--- a/smart-wallpaper
+++ b/smart-wallpaper
@@ -43,11 +43,14 @@ print_usage() {
 }
 
 set_wallpaper() {
-
   if [[ $procid != '' ]]; then
     kill $procid
   fi
 
+  if [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then
+     swaybg -i $1 &
+     procid=$!
+  else
   killall xwinwrap
   killall gifview #TODO: gotta kill mpv as well (but not all instances) HELP NEEDED
 
@@ -62,7 +65,7 @@ set_wallpaper() {
       nice xwinwrap -ni -fs -st -sp -nf -ov -s -r -debug -- feh --window-id WID -F --zoom fill -g $resolution $1
       procid=$!
     fi
-
+    fi
 }
 
 drawwallpaper(){