From ba7fd1da1eb2bf306edbcb5fd78cf2318eaec6f7 Mon Sep 17 00:00:00 2001 From: QuantumSoul <19613657+BinaryQuantumSoul@users.noreply.github.com> Date: Sat, 24 Jan 2026 12:33:50 +0100 Subject: [PATCH] Zathura template --- Assets/Templates/zathurarc | 31 +++++++++++++++++++++++++++ Scripts/bash/template-apply.sh | 27 +++++++++++++++++++++-- Services/Theming/TemplateRegistry.qml | 12 +++++++++++ 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 Assets/Templates/zathurarc diff --git a/Assets/Templates/zathurarc b/Assets/Templates/zathurarc new file mode 100644 index 000000000..248a52cc7 --- /dev/null +++ b/Assets/Templates/zathurarc @@ -0,0 +1,31 @@ +set default-bg "{{colors.surface.default.rgba | set_alpha: 0.8}}" +set default-fg "{{colors.on_surface.default.hex}}" +set recolor-lightcolor "rgba(0,0,0,0)" +set recolor-darkcolor "{{colors.on_surface.default.hex}}" + +set statusbar-bg "{{colors.on_primary.default.hex}}" +set statusbar-fg "{{colors.primary.default.hex}}" +set inputbar-bg "{{colors.on_primary.default.hex}}" +set inputbar-fg "{{colors.primary.default.hex}}" + +set notification-bg "{{colors.on_primary.default.hex}}" +set notification-fg "{{colors.primary.default.hex}}" +set notification-error-bg "{{colors.on_error.default.hex}}" +set notification-error-fg "{{colors.error.default.hex}}" +set notification-warning-bg "{{colors.primary_fixed.default.hex}}" +set notification-warning-fg "{{colors.error_container.default.hex}}" + +set index-bg "rgba(0,0,0,0)" +set index-fg "{{colors.on_surface.default.hex}}" +set index-active-bg "{{colors.primary.default.hex}}" +set index-active-fg "{{colors.on_primary.default.hex}}" +set highlight-color "{{colors.primary_fixed.default.rgba | set_alpha: 0.5}}" +set highlight-active-color "{{colors.primary_fixed_dim.default.rgba | set_alpha: 0.5}}" +set highlight-fg "{{colors.on_primary.default.hex}}" + +set completion-bg "{{colors.on_primary.default.hex}}" +set completion-fg "{{colors.primary.default.hex}}" +set completion-group-bg "{{colors.on_primary.default.hex}}" +set completion-group-fg "{{colors.primary.default.hex}}" +set completion-highlight-fg "{{colors.on_primary.default.hex}}" +set completion-highlight-bg "{{colors.primary.default.hex}}" diff --git a/Scripts/bash/template-apply.sh b/Scripts/bash/template-apply.sh index 0dfd0ce10..a1e48ef4e 100755 --- a/Scripts/bash/template-apply.sh +++ b/Scripts/bash/template-apply.sh @@ -432,10 +432,11 @@ mango) echo "Warning: mmsg command not found, manual restart may be needed." >&2 fi ;; + btop) echo "🎨 Applying 'noctalia' theme to btop..." CONFIG_FILE="$HOME/.config/btop/btop.conf" - + if [ -f "$CONFIG_FILE" ]; then if grep -q '^color_theme = "noctalia"' "$CONFIG_FILE"; then echo "Theme already set to noctalia, skipping modification." @@ -447,7 +448,7 @@ btop) fi echo "✅ Updated btop config to use noctalia theme." fi - + if pgrep -x btop >/dev/null; then echo "Reloading btop..." pkill -SIGUSR2 -x btop @@ -456,6 +457,28 @@ btop) echo "Warning: btop config file not found at $CONFIG_FILE" >&2 fi ;; + +zathura) + echo "🎨 Applying 'noctalia' theme to zathura..." + + ZATHURA_INSTANCES=$(dbus-send --session \ + --dest=org.freedesktop.DBus \ + --type=method_call \ + --print-reply \ + /org/freedesktop/DBus \ + org.freedesktop.DBus.ListNames \ + | grep -o 'org.pwmt.zathura.PID-[0-9]*') + + for id in $ZATHURA_INSTANCES; do + dbus-send --session \ + --dest="$id" \ + --type=method_call \ + /org/pwmt/zathura \ + org.pwmt.zathura.ExecuteCommand \ + string:"source" + done + ;; + *) # Handle unknown application names. echo "Error: Unknown application '$APP_NAME'." >&2 diff --git a/Services/Theming/TemplateRegistry.qml b/Services/Theming/TemplateRegistry.qml index bee64660b..d751fc4dd 100644 --- a/Services/Theming/TemplateRegistry.qml +++ b/Services/Theming/TemplateRegistry.qml @@ -363,6 +363,18 @@ Singleton { } ], "postProcess": () => `${templateApplyScript} btop` + }, + { + "id": "zathura", + "name": "Zathura", + "category": "misc", + "input": "zathurarc", + "outputs": [ + { + "path": "~/.config/zathura/noctaliarc" + } + ], + "postProcess": () => `${templateApplyScript} zathura` } ]