From 71fabc3a5f7bb908408fb4e94ec999a544f087f6 Mon Sep 17 00:00:00 2001 From: Nico Date: Thu, 1 Jan 2026 16:05:48 +1100 Subject: [PATCH 1/2] matugen: change macOS accent colour --- stow/.config/matugen/config.toml | 17 +++++++++++++++++ .../matugen/scripts/macos-accent-notification | 14 ++++++++++++++ 2 files changed, 31 insertions(+) create mode 100755 stow/.config/matugen/scripts/macos-accent-notification diff --git a/stow/.config/matugen/config.toml b/stow/.config/matugen/config.toml index f29f753..c3be824 100644 --- a/stow/.config/matugen/config.toml +++ b/stow/.config/matugen/config.toml @@ -86,3 +86,20 @@ output_path = '~/.config/ghostty/matugen' input_path = './templates/vicinae.toml' output_path = '~/.local/share/vicinae/themes/matugen.toml' post_hook = 'vicinae theme set matugen' + +[templates.macos-accent] +colors_to_compare = [ + { name = "-1", color = "#696766" }, # graphite + { name = "0", color = "#C03437" }, # red + { name = "1", color = "#C65D0A" }, # orange + { name = "2", color = "#BE8F0F" }, # yellow + { name = "3", color = "#409226" }, # green + { name = "4", color = "#1B5DC7" }, # blue + { name = "5", color = "#AD29AB" }, # purple + { name = "6", color = "#BC3F77" }, # pink +] + +compare_to = "{{colors.primary.default.hex}}" +pre_hook = "defaults write -globalDomain AppleAccentColor -int {{closest_color}}" +post_hook = "~/.config/matugen/scripts/macos-accent-notification" +input_path = "/dev/null" diff --git a/stow/.config/matugen/scripts/macos-accent-notification b/stow/.config/matugen/scripts/macos-accent-notification new file mode 100755 index 0000000..261fc01 --- /dev/null +++ b/stow/.config/matugen/scripts/macos-accent-notification @@ -0,0 +1,14 @@ +#!/usr/bin/env swift +// from: https://alexwlchan.net/2022/changing-the-macos-accent-colour/ + +import Foundation + +let notifications = [ + "AppleColorPreferencesChangedNotification", + "AppleAquaColorVariantChanged" +] + +for name in notifications { + let notifyEvent = Notification.Name(name) + DistributedNotificationCenter.default().post(name: notifyEvent, object: nil) +} From d39af5541771532cd25f1aa8c5a8b92ad1c87d62 Mon Sep 17 00:00:00 2001 From: Nico Date: Thu, 1 Jan 2026 16:06:30 +1100 Subject: [PATCH 2/2] matugen: change macOS dark/light mode --- stow/.config/matugen/config.toml | 4 ++++ stow/.config/matugen/scripts/macos-darkmode.sh | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100755 stow/.config/matugen/scripts/macos-darkmode.sh diff --git a/stow/.config/matugen/config.toml b/stow/.config/matugen/config.toml index c3be824..532dde9 100644 --- a/stow/.config/matugen/config.toml +++ b/stow/.config/matugen/config.toml @@ -103,3 +103,7 @@ compare_to = "{{colors.primary.default.hex}}" pre_hook = "defaults write -globalDomain AppleAccentColor -int {{closest_color}}" post_hook = "~/.config/matugen/scripts/macos-accent-notification" input_path = "/dev/null" + +[templates.macos-dark-mode] +input_path = "/dev/null" +post_hook = '~/.config/matugen/scripts/macos-darkmode.sh {{mode}}' diff --git a/stow/.config/matugen/scripts/macos-darkmode.sh b/stow/.config/matugen/scripts/macos-darkmode.sh new file mode 100755 index 0000000..fd9d44e --- /dev/null +++ b/stow/.config/matugen/scripts/macos-darkmode.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ "$1" = "dark" ]; then + osascript -e 'tell application "System Events" to tell appearance preferences to set dark mode to true' +elif [ "$1" = "light" ]; then + osascript -e 'tell application "System Events" to tell appearance preferences to set dark mode to false' +else + echo "$0: [dark|light]" +fi