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

Commit

Permalink
General: Fix wallpaper bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanaraps committed Jun 28, 2017
1 parent c067948 commit 153a7f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pywal/gen_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ def random_img(img_dir):
# Add all images to a list excluding the current wallpaper.
file_types = (".png", ".jpg", ".jpeg", ".jpe", ".gif")
images = [img for img in os.scandir(img_dir)
if img.name.endswith(file_types) and img.name != wallpaper]
if img.name.endswith(file_types) and img.name != current_wall]

# If no images are found, use the current wallpaper.
if not images:
return pathlib.Path(wallpaper)
return pathlib.Path(wallpaper[0])

return pathlib.Path(img_dir / random.choice(images).name)

Expand Down

0 comments on commit 153a7f9

Please sign in to comment.