matugen: change macOS dark/light mode
This commit is contained in:
parent
71fabc3a5f
commit
d39af55417
2 changed files with 13 additions and 0 deletions
|
|
@ -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}}'
|
||||
|
|
|
|||
9
stow/.config/matugen/scripts/macos-darkmode.sh
Executable file
9
stow/.config/matugen/scripts/macos-darkmode.sh
Executable file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue