Add support for using dark/light mode
This commit is contained in:
parent
12dd8faba4
commit
7187d52ee6
3 changed files with 148 additions and 89 deletions
23
zsh/dark-mode-notify.zsh
Executable file
23
zsh/dark-mode-notify.zsh
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
function switch-dark-mode()
|
||||
{
|
||||
local darkMode=true;
|
||||
|
||||
if [[ $(defaults read -g AppleInterfaceStyle 2> /dev/null) != 'Dark' ]]; then
|
||||
darkMode=false
|
||||
fi
|
||||
|
||||
if [[ $darkMode == true ]]; then
|
||||
echo "Switched to dark mode"
|
||||
export MACOS_APPEARANCE="dark"
|
||||
else
|
||||
echo "Switched to light mode"
|
||||
export MACOS_APPEARANCE="light"
|
||||
fi
|
||||
|
||||
# Reload zshrc
|
||||
pkill -usr1 zsh
|
||||
}
|
||||
|
||||
switch-dark-mode
|
Loading…
Add table
Add a link
Reference in a new issue