From c2e64a17e0a5b48196979f688a948d62388e48d8 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 21 Sep 2025 12:39:47 +0200 Subject: [PATCH] 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. --- .dotter/global.toml | 3 --- desktop/.config/flavours/config.toml | 8 ++------ desktop/.config/mako/config | 8 +++----- desktop/.config/sh/env.d/mako-create-style-dir.sh | 5 +++++ 4 files changed, 10 insertions(+), 14 deletions(-) create mode 100644 desktop/.config/sh/env.d/mako-create-style-dir.sh diff --git a/.dotter/global.toml b/.dotter/global.toml index f85bfe2..f39f98d 100644 --- a/.dotter/global.toml +++ b/.dotter/global.toml @@ -93,9 +93,6 @@ writing = "~" depends = ["linux", "desktop", "multimedia", "qutebrowser"] [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 = "~" diff --git a/desktop/.config/flavours/config.toml b/desktop/.config/flavours/config.toml index 517afc6..1780d13 100644 --- a/desktop/.config/flavours/config.toml +++ b/desktop/.config/flavours/config.toml @@ -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]] diff --git a/desktop/.config/mako/config b/desktop/.config/mako/config index 1b053df..0b23b51 100644 --- a/desktop/.config/mako/config +++ b/desktop/.config/mako/config @@ -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 diff --git a/desktop/.config/sh/env.d/mako-create-style-dir.sh b/desktop/.config/sh/env.d/mako-create-style-dir.sh new file mode 100644 index 0000000..2c1e6e7 --- /dev/null +++ b/desktop/.config/sh/env.d/mako-create-style-dir.sh @@ -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"