]> git.phdru.name Git - xsetbg.git/commitdiff
Feat: Display WEBP images using `display` from ImageMagic
authorOleg Broytman <phd@phdru.name>
Fri, 19 Feb 2021 20:29:35 +0000 (23:29 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 19 Feb 2021 20:29:35 +0000 (23:29 +0300)
xsetbg.py

index 1f318c7265edf8fc13e7cebf76eaeae94b357abb..706e183ef2cad8338877b5a6c59bfa04a419c2c5 100644 (file)
--- a/xsetbg.py
+++ b/xsetbg.py
@@ -129,6 +129,12 @@ def change(force=False):
         if ext in ('tif', 'tiff'):
             program_options[0] = 'xsetbg'
 
+        if ext == 'webp':
+            program_options = ['display', '-backdrop',
+                               '-background', random.choice(borders),
+                               '-window', 'root',
+                               row.full_name.encode(fs_encoding)]
+
         rc = subprocess.call(program_options)
         if rc:
             error("cannot execute xli!")