Post-Script Specification
Post-scripts are shell scripts that run after a pattern is filled. They’re used to reload or restart applications so theme changes take effect immediately. They live in {desktop}/gtheme/post-scripts/.
Naming convention
The script name must match the pattern name it corresponds to:
| Pattern | Post-Script |
|---|---|
kitty.pattern | kitty.sh |
dunst.pattern | dunst.sh |
hyprland-colors.pattern | hyprland-colors.sh |
Arguments
The post-script receives the output file path (from the pattern’s <[output-file]>) as its first argument ($1). Not all scripts need this value, but it’s always available.
Example
Here’s a post-script that restarts dunst after its config is regenerated:
#!/bin/bash
pkill dunst &>/dev/nullexit 0And one that tells kitty to reload its configuration:
#!/bin/bash
pkill -USR1 kittyexit 0Special: desktop-exit.sh
There is one special post-script called desktop-exit.sh that runs every time you switch away from the current desktop. It lets you clean up processes specific to the current window manager before applying a new desktop.
#!/bin/sh
sleep 1killall -u $(whoami)exit $?