export: Add wallpaper to export files,

This commit is contained in:
Dylan Araps 2017-07-09 23:39:35 +10:00
parent dbea281483
commit 1d63b05e40
3 changed files with 8 additions and 5 deletions

View File

@ -95,11 +95,6 @@ def process_args(args):
elif args.f:
colors_plain = util.read_file_json(args.f)
# If wallpaper is unset, set it to "None"
if "wallpaper" not in colors_plain:
colors_plain["wallpaper"] = "None"
args.n = True
# -i or -f
if args.i or args.f:
sequences.send_sequences(colors_plain, args.t)

View File

@ -54,6 +54,11 @@ def read_file_json(input_file):
"""Read data from a json file."""
with open(input_file) as json_file:
data = json.load(json_file)
# If wallpaper is unset, set it to "None"
if "wallpaper" not in data:
data["wallpaper"] = "None"
return data

View File

@ -82,6 +82,9 @@ def set_desktop_wallpaper(desktop, img):
def set_wallpaper(img):
"""Set the wallpaper."""
if not os.path.isfile(img):
return
desktop = get_desktop_env()
if desktop: