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