diff options
Diffstat (limited to 'src/caelestia')
| -rw-r--r-- | src/caelestia/utils/wallpaper.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/caelestia/utils/wallpaper.py b/src/caelestia/utils/wallpaper.py index abaf192..6c6532c 100644 --- a/src/caelestia/utils/wallpaper.py +++ b/src/caelestia/utils/wallpaper.py @@ -20,8 +20,7 @@ from caelestia.utils.scheme import Scheme, get_scheme from caelestia.utils.theme import apply_colours -def is_valid_image(path: Path | str) -> bool: - path = Path(path) +def is_valid_image(path: Path) -> bool: return path.is_file() and path.suffix in [".jpg", ".jpeg", ".png", ".webp", ".tif", ".tiff"] @@ -126,6 +125,9 @@ def get_colours_for_wall(wall: Path | str, no_smart: bool) -> None: def set_wallpaper(wall: Path | str, no_smart: bool) -> None: + # Make path absolute + wall = Path(wall).resolve() + if not is_valid_image(wall): raise ValueError(f'"{wall}" is not a valid image') |