]> git.phdru.name Git - xsetbg.git/blobdiff - xsetbg.py
Fix(DB): Fix column encoding
[xsetbg.git] / xsetbg.py
index 1f318c7265edf8fc13e7cebf76eaeae94b357abb..825b20eb0f9c927614a5285d4c8467524b3c5380 100644 (file)
--- a/xsetbg.py
+++ b/xsetbg.py
@@ -50,11 +50,11 @@ if xsetbg_conf.has_option("xsetbg", "min_delay"):
     min_delay = xsetbg_conf.get("xsetbg", "min_delay")
 
     # Borrowed from http://stackoverflow.com/a/2765366
-    td_re = re.compile('(?:(?P<years>\d+)y)?'
-                       '(?:(?P<months>\d+)m)?'
-                       '(?:(?P<days>\d+)d)?'
-                       '(?:T(?:(?P<hours>\d+)h)?'
-                       '(?:(?P<minutes>\d+)m)?(?:(?P<seconds>\d+)s)?)?')
+    td_re = re.compile('(?:(?P<years>\\d+)y)?'
+                       '(?:(?P<months>\\d+)m)?'
+                       '(?:(?P<days>\\d+)d)?'
+                       '(?:T(?:(?P<hours>\\d+)h)?'
+                       '(?:(?P<minutes>\\d+)m)?(?:(?P<seconds>\\d+)s)?)?')
     td_dict = td_re.match(min_delay).groupdict(0)
     delta = timedelta(days=int(td_dict['days']) +
                       (int(td_dict['months']) * 30) +
@@ -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!")