mirror of
https://github.com/caelestia-dots/cli.git
synced 2026-06-05 14:59:29 -05:00
feat: expose more environment variables in post-hook (#107)
* feat: expose more environment variables in post-hook * fix: formatted
This commit is contained in:
@@ -191,7 +191,7 @@ All configuration options are in `~/.config/caelestia/cli.json`.
|
|||||||
"extraArgs": []
|
"extraArgs": []
|
||||||
},
|
},
|
||||||
"wallpaper": {
|
"wallpaper": {
|
||||||
"postHook": "echo $WALLPAPER_PATH"
|
"postHook": "echo $WALLPAPER_PATH $SCHEME_NAME $SCHEME_FLAVOUR $SCHEME_MODE $SCHEME_VARIANT $SCHEME_COLOURS"
|
||||||
},
|
},
|
||||||
"theme": {
|
"theme": {
|
||||||
"enableTerm": true,
|
"enableTerm": true,
|
||||||
|
|||||||
@@ -192,7 +192,16 @@ def set_wallpaper(wall: Path, no_smart: bool) -> None:
|
|||||||
subprocess.run(
|
subprocess.run(
|
||||||
post_hook,
|
post_hook,
|
||||||
shell=True,
|
shell=True,
|
||||||
env={**os.environ, "WALLPAPER_PATH": str(wall)},
|
env={
|
||||||
|
**os.environ,
|
||||||
|
"WALLPAPER_PATH": str(wall),
|
||||||
|
"SCHEME_NAME": scheme.name,
|
||||||
|
"SCHEME_FLAVOUR": scheme.flavour,
|
||||||
|
"SCHEME_MODE": scheme.mode,
|
||||||
|
"SCHEME_VARIANT": scheme.variant,
|
||||||
|
"SCHEME_COLOURS": json.dumps(scheme.colours),
|
||||||
|
"THUMBNAIL_PATH": str(thumb),
|
||||||
|
},
|
||||||
stderr=subprocess.DEVNULL,
|
stderr=subprocess.DEVNULL,
|
||||||
)
|
)
|
||||||
except (FileNotFoundError, json.JSONDecodeError):
|
except (FileNotFoundError, json.JSONDecodeError):
|
||||||
|
|||||||
Reference in New Issue
Block a user