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": [] "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,
+10 -1
View File
@@ -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):