summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2017-06-28 20:38:11 +1000
committerDylan Araps <dylan.araps@gmail.com>2017-06-28 20:38:11 +1000
commita249f2083b5c88902eb656ecea2ba3e05962b74b (patch)
tree8aaaab391dcb0d3ea17d95a4f11e13ddbc13bb86
parent153a7f92d2db58cff969ae9a75bcdb3e601bc2bb (diff)
General: Better solution to bug.
-rwxr-xr-xpywal/gen_colors.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pywal/gen_colors.py b/pywal/gen_colors.py
index e1e3478..3f5e16e 100755
--- a/pywal/gen_colors.py
+++ b/pywal/gen_colors.py
@@ -17,8 +17,8 @@ def random_img(img_dir):
current_wall = pathlib.Path(CACHE_DIR / "wal")
if current_wall.is_file():
- wallpaper = util.read_file(current_wall)
- current_wall = os.path.basename(wallpaper[0])
+ current_wall = util.read_file(current_wall)
+ current_wall = os.path.basename(current_wall[0])
# Add all images to a list excluding the current wallpaper.
file_types = (".png", ".jpg", ".jpeg", ".jpe", ".gif")
@@ -27,7 +27,8 @@ def random_img(img_dir):
# If no images are found, use the current wallpaper.
if not images:
- return pathlib.Path(wallpaper[0])
+ print("image: No new images found (nothing to do), exiting...")
+ quit(1)
return pathlib.Path(img_dir / random.choice(images).name)