forked from Shinonome/caelestia-cli
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": []
|
||||
},
|
||||
"wallpaper": {
|
||||
"postHook": "echo $WALLPAPER_PATH"
|
||||
"postHook": "echo $WALLPAPER_PATH $SCHEME_NAME $SCHEME_FLAVOUR $SCHEME_MODE $SCHEME_VARIANT $SCHEME_COLOURS"
|
||||
},
|
||||
"theme": {
|
||||
"enableTerm": true,
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user