Skip to content

Instantly share code, notes, and snippets.

@gko
Created February 22, 2020 07:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gko/ecffa2cb8808b1b9fa20b5ba2fdffdf7 to your computer and use it in GitHub Desktop.
Save gko/ecffa2cb8808b1b9fa20b5ba2fdffdf7 to your computer and use it in GitHub Desktop.
switch colorscheme between 7h and 18h keep the light theme
function alter_theme() {
local current_hour=$(date +%H)
if [[ $current_hour -ge 7 && $current_hour -lt 18 ]]; then
base16_classic-light
else
base16_material-palenight
fi
}
[[ -z $precmd_functions ]] && precmd_functions=()
precmd_functions=($precmd_functions alter_theme)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment