+config_dirs.append(xsetbg_dir)
+
+for d in config_dirs:
+ xsetbg_conf_file = os.path.join(d, 'xsetbg.conf')
+ if os.path.exists(xsetbg_conf_file):
+ xsetbg_conf = ConfigParser(inline_comment_prefixes=(';', '#'))
+ xsetbg_conf.read(xsetbg_conf_file)
+ break
+else:
+ raise RuntimeError("Cannot find xsetbg.conf; searched %s", config_dirs)