mako: Include color configuration

Include the color config for mako from ~/.local/state/mako/style instead
of hardcoding it or templating it into the config file.

This means we have to ensure the directory and file exist before running
mako which we do with an `env.d` startup script.
This commit is contained in:
Marty Oehme 2025-09-21 12:39:47 +02:00
parent 6086f47023
commit c2e64a17e0
Signed by: Marty
GPG key ID: 4E535BC19C61886E
4 changed files with 10 additions and 14 deletions

View file

@ -73,13 +73,9 @@ start = "/* Start flavours */"
end = "/* End flavours */"
[[items]]
# MAKO DOES NOT SUPPORT INCLUDES YET
template = "mako"
file = "~/.config/mako/config"
light = false
rewrite = false
start = "# Start flavours"
end = "# End flavours"
file = "~/.local/state/mako/style"
rewrite = true
hook = "killall mako"
[[items]]

View file

@ -9,11 +9,9 @@ default-timeout=5000
ignore-timeout=1
font=monospace 14
# Intentionally left empty, automatically filled by flavours
# on switching theme.
# Start flavours
# End flavours
# this requires the file to exist
# or mako will not start
include=~/.local/state/mako/style
[urgency=critical]
#on-notify=exec mpv /usr/share/sounds/freedesktop/stereo/message.oga

View file

@ -0,0 +1,5 @@
#!/usr/bin/env sh
# Ensure the directory and file for mako style exists or it errors out on startup
[ -e "${XDG_STATE_HOME:-$HOME/.local/state}/mako" ] || mkdir -p "${XDG_STATE_HOME:-$HOME/.local/state}/mako"
[ -f "${XDG_STATE_HOME:-$HOME/.local/state}/mako/style" ] || touch "${XDG_STATE_HOME:-$HOME/.local/state}/mako/style"