forked from Shinonome/caelestia-cli
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:
|
||||
if self.name == "dynamic":
|
||||
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:
|
||||
self._colours = read_colours_from_file(self.get_colours_path())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user