add setup script for kitty in mac
This commit is contained in:
parent
54c2e95e21
commit
ebef0c399a
2 changed files with 32 additions and 0 deletions
19
kitty/setup-zsh.sh
Executable file
19
kitty/setup-zsh.sh
Executable file
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
kitten @ set-font-size --all 14.0
|
||||||
|
|
||||||
|
CURRENT_HOUR=$(date +"%H")
|
||||||
|
SEVEN_AM=7
|
||||||
|
SEVEN_PM=19
|
||||||
|
|
||||||
|
TERM_COLOR_MODE=dark
|
||||||
|
if [ $CURRENT_HOUR -ge $SEVEN_AM ] && [ $CURRENT_HOUR -lt $SEVEN_PM ]; then
|
||||||
|
TERM_COLOR_MODE=light
|
||||||
|
fi
|
||||||
|
if [ "$TERM_COLOR_MODE" = "light" ]; then
|
||||||
|
kitten @ set-colors --all "$HOME/.config/kitty/light.conf"
|
||||||
|
else
|
||||||
|
kitten @ set-colors --all "$HOME/.config/kitty/dark.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export TERM_COLOR_MODE
|
||||||
13
zsh/.zshrc
13
zsh/.zshrc
|
|
@ -156,6 +156,19 @@ PS1="%n@%m:%~ $ "
|
||||||
|
|
||||||
unset color_prompt
|
unset color_prompt
|
||||||
|
|
||||||
|
# setup kitty, it will export TERM_COLOR_MODE (can be light or dark)
|
||||||
|
source ~/.config/kitty/setup.sh
|
||||||
|
# function to toggle kitty terminal theme
|
||||||
|
toggle_theme() {
|
||||||
|
if [ "$TERM_COLOR_MODE" == "light" ]; then
|
||||||
|
export TERM_COLOR_MODE=dark
|
||||||
|
kitten @ set-colors --all "$HOME/.config/kitty/dark.conf"
|
||||||
|
else
|
||||||
|
export TERM_COLOR_MODE=light
|
||||||
|
kitten @ set-colors --all "$HOME/.config/kitty/light.conf"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
type -p curl >/dev/null || echo -e "$WARNING curl is not installed"
|
type -p curl >/dev/null || echo -e "$WARNING curl is not installed"
|
||||||
|
|
||||||
command -v nvm > /dev/null 2>&1
|
command -v nvm > /dev/null 2>&1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue