mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-03-10 05:00:46 +01:00
export: Add wallpaper to export files,
This commit is contained in:
parent
dbea281483
commit
1d63b05e40
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user