mirror of
https://github.com/caelestia-dots/cli.git
synced 2026-06-05 14:59:29 -05:00
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user