Add dark mode support

This commit is contained in:
Max Bucknell 2019-06-04 12:40:38 +01:00
parent b74f8ffd93
commit 7122baebd7
3 changed files with 35 additions and 9 deletions

6
bin/isdark Executable file
View file

@ -0,0 +1,6 @@
#! /usr/bin/env osascript
tell application "System Events"
tell appearance preferences
dark mode
end tell
end tell

View file

@ -141,8 +141,16 @@ syntax on
filetype plugin indent on filetype plugin indent on
" Theme configuration " Theme configuration
if $MACOS_DARKMODE
set background=dark
else
set background=light
endif
let g:gruvbox_italic = 1 let g:gruvbox_italic = 1
colorscheme maxbucknell
colorscheme gruvbox
" I want floating windows to have the same syntax highlighting as normal vim " I want floating windows to have the same syntax highlighting as normal vim
" things. " things.

View file

@ -30,11 +30,14 @@ PATH="/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/2.6.0/bin:$PATH"
export PYTHONPATH="$PYTHONPATH:$HOME/dotfiles/lib/python" export PYTHONPATH="$PYTHONPATH:$HOME/dotfiles/lib/python"
# Rust # Rust
source $HOME/.cargo/env # source $HOME/.cargo/env
# Go # Go
PATH="$HOME/go/bin:$PATH" PATH="$HOME/go/bin:$PATH"
# Yarn ffs
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
## Completion ## Completion
# Load up the extra Z Shell completions # Load up the extra Z Shell completions
@ -160,6 +163,15 @@ setopt extended_history
# to do things correctly and see if it's slow. # to do things correctly and see if it's slow.
setopt hist_lex_words setopt hist_lex_words
# Dark Mode Support
isdark="$($HOME/dotfiles/bin/isdark)"
if [[ "$isdark" == 'true' ]]
then
export MACOS_DARKMODE=1
else
export MACOS_DARKMODE=0
fi
# Liquid Prompt! # Liquid Prompt!
source "$HOME/.zsh/liquidprompt/liquidprompt" source "$HOME/.zsh/liquidprompt/liquidprompt"
@ -197,11 +209,11 @@ function select_session {
fi fi
} }
if [ -z "$TMUX" ] # Disabling the below because Tmux has been playing up.
then #
neofetch # if [ -z "$TMUX" ]
fi # then
# neofetch
# fi
select_session # select_session
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"