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

@ -93,9 +93,6 @@ writing = "~"
depends = ["linux", "desktop", "multimedia", "qutebrowser"] depends = ["linux", "desktop", "multimedia", "qutebrowser"]
[desktop.files] [desktop.files]
"desktop/.config/flavours/templates" = { target = "~/.config/flavours/templates", type = "symbolic" }
"desktop/.config/waybar/config" = { target = "~/.config/waybar/config", type = "symbolic" }
"desktop/.config/mako/config" = { target = "~/.config/mako/config", type = "template", prepend = "# TEMPLATED BY DOTTER\n" }
"desktop/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" } "desktop/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" }
desktop = "~" desktop = "~"

View file

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

View file

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