mirror of
https://github.com/caelestia-dots/cli.git
synced 2026-06-08 16:29:28 -05:00
scheme: handle no wallpaper dynamic scheme
Throw actually readable error and notify
This commit is contained in:
@@ -157,7 +157,19 @@ class Scheme:
|
|||||||
|
|
||||||
def _update_colours(self) -> None:
|
def _update_colours(self) -> None:
|
||||||
if self.name == "dynamic":
|
if self.name == "dynamic":
|
||||||
self._colours = get_colours_for_image()
|
try:
|
||||||
|
self._colours = get_colours_for_image()
|
||||||
|
except FileNotFoundError:
|
||||||
|
if self.notify:
|
||||||
|
notify(
|
||||||
|
"-u",
|
||||||
|
"critical",
|
||||||
|
"Unable to set dynamic scheme",
|
||||||
|
"No wallpaper set. Please set a wallpaper via `caelestia wallpaper` before setting a dynamic scheme.",
|
||||||
|
)
|
||||||
|
raise ValueError(
|
||||||
|
"No wallpaper set. Please set a wallpaper via `caelestia wallpaper` before setting a dynamic scheme."
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
self._colours = read_colours_from_file(self.get_colours_path())
|
self._colours = read_colours_from_file(self.get_colours_path())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user