summaryrefslogtreecommitdiff
path: root/pywal
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2017-07-09 23:39:35 +1000
committerDylan Araps <dylan.araps@gmail.com>2017-07-09 23:39:35 +1000
commit1d63b05e408d9f63e0147cdd9b1988ef63100eb9 (patch)
tree6c4faa8feda838f8fd7769608b815b0ef76a6a36 /pywal
parentdbea2814836e03fac6cf5a314d375f30cb7a12e8 (diff)
export: Add wallpaper to export files,
Diffstat (limited to 'pywal')
-rw-r--r--pywal/__main__.py5
-rw-r--r--pywal/util.py5
-rw-r--r--pywal/wallpaper.py3
3 files changed, 8 insertions, 5 deletions
diff --git a/pywal/__main__.py b/pywal/__main__.py
index a816360..cdd5001 100644
--- a/pywal/__main__.py
+++ b/pywal/__main__.py
@@ -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)
diff --git a/pywal/util.py b/pywal/util.py
index 2796d8e..6c5b420 100644
--- a/pywal/util.py
+++ b/pywal/util.py
@@ -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
diff --git a/pywal/wallpaper.py b/pywal/wallpaper.py
index 59f1aeb..5e524a3 100644
--- a/pywal/wallpaper.py
+++ b/pywal/wallpaper.py
@@ -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: