X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=xsetbg.py;h=1aea77f28e2493885bdd24929ed0e9d79da47942;hb=5be27ee9d6b805200db0295a9426d22159336cbe;hp=2658956c39fc39e78e36c84476ccb994254a4301;hpb=13c9b4aeb309e7f3d92323041cb904e662390eaf;p=xsetbg.git diff --git a/xsetbg.py b/xsetbg.py index 2658956..1aea77f 100644 --- a/xsetbg.py +++ b/xsetbg.py @@ -6,12 +6,6 @@ using xli program. """ -__author__ = "Oleg Broytman " -__copyright__ = "Copyright (C) 2000-2015 PhiloSoft Design" -__license__ = "GNU GPL" - -__all__ = ['change'] - from fcntl import flock, LOCK_EX, LOCK_UN, LOCK_NB from datetime import timedelta import os @@ -24,6 +18,8 @@ from time import time from xsetbg_conf import xsetbg_dir, xsetbg_conf from xsetbg_db import xsetbg_db +__all__ = ['change'] + def error(error_str): sys.exit("%s: Error: %s\n" % (sys.argv[0], error_str)) @@ -81,6 +77,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: @@ -121,7 +118,7 @@ def change(force=False): 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: