feat: expose more environment variables in post-hook (#107)

* feat: expose more environment variables in post-hook

* fix: formatted
This commit is contained in:
Haikal
2026-04-29 21:56:07 +08:00
committed by GitHub
parent c18f749f24
commit 5c9ce66c03
2 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -191,7 +191,7 @@ All configuration options are in `~/.config/caelestia/cli.json`.
"extraArgs": []
},
"wallpaper": {
"postHook": "echo $WALLPAPER_PATH"
"postHook": "echo $WALLPAPER_PATH $SCHEME_NAME $SCHEME_FLAVOUR $SCHEME_MODE $SCHEME_VARIANT $SCHEME_COLOURS"
},
"theme": {
"enableTerm": true,
+10 -1
View File
@@ -192,7 +192,16 @@ def set_wallpaper(wall: Path, no_smart: bool) -> None:
subprocess.run(
post_hook,
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,
)
except (FileNotFoundError, json.JSONDecodeError):