Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
General: Better solution to bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanaraps committed Jun 28, 2017
1 parent 153a7f9 commit a249f20
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pywal/gen_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)

Expand Down

0 comments on commit a249f20

Please sign in to comment.