X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=xsetbg.py;h=98b8aaafd7599d23e9d35d19c1063c16a036bb45;hb=36fc78a24c5fcf75cb5301a3a1c402a7a6d26dd8;hp=8f4f6c8b96029aa52da78431c73bb14e910d9e7e;hpb=2f99c9bc2e47a031db73de534ff56fec6788854e;p=xsetbg.git diff --git a/xsetbg.py b/xsetbg.py index 8f4f6c8..98b8aaa 100644 --- a/xsetbg.py +++ b/xsetbg.py @@ -81,6 +81,7 @@ if xsetbg_db.select('last_shown IS NULL OR last_shown < %d' % error("No unshown images found. Run rescan_fs.py " "or decrease min_delay. Abort.") +fs_encoding = xsetbg_conf.get("images", "fs_encoding") def change(force=False): # Use the program's file as the lock file: @@ -114,14 +115,14 @@ def change(force=False): current_time - min_delay) old_shown_count = old_shown_select.count() if old_shown_count: - row = old_shown_select[random.randint(0, not_shown_count - 1)] + row = old_shown_select[random.randint(0, old_shown_count - 1)] else: error("No images to show found. Run rescan_fs.py " "or decrease min_delay. Abort.") program_options = ["xli", "-border", random.choice(borders), "-center", "-onroot", "-quiet", "-zoom", "auto", - row.full_name] + row.full_name.encode(fs_encoding)] rc = subprocess.call(program_options) if rc: