Last active
January 23, 2019 13:33
-
-
Save jleedev/f597ecf97889640ac6ce0151be2c4992 to your computer and use it in GitHub Desktop.
dark mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! SetMode() | |
call system("defaults read -g AppleInterfaceStyle") | |
if v:shell_error | |
se bg=light | |
else | |
se bg=dark | |
endif | |
endfunction | |
call SetMode() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults read -g AppleInterfaceStyle 2>&- >&- | |
if (( $? )) | |
then | |
# light mode | |
export COLORFGBG='0;15' | |
else | |
# dark mode | |
export COLORFGBG='15;0' | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SendEnv COLORFGBG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -g update-environment COLORFGBG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AcceptEnv COLORFGBG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment