feat(theme): Add theme support
Add support for both pywal and theme.sh terminal themes
This commit is contained in:
parent
654a2ad327
commit
0100d1c64f
32
theme
Normal file
32
theme
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
# Attempt to load pywal theme first (unless disabled)
|
||||||
|
if has 'wal' ; then
|
||||||
|
if [[ -z $NO_PYWAL ]]; then
|
||||||
|
if [[ -e $XDG_CACHE_HOME/wal/sequences ]]; then
|
||||||
|
cat $XDG_CACHE_HOME/wal/sequences && return
|
||||||
|
fi
|
||||||
|
wal -qnR && return
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Load theme.sh theme uses theme_history to set
|
||||||
|
if has 'theme.sh'; then
|
||||||
|
# Load the last set theme automatically
|
||||||
|
[ -e ~/.config/.theme_history ] && theme.sh "$(theme.sh -l|tail -n1)"
|
||||||
|
|
||||||
|
|
||||||
|
# Toggle between last set themes
|
||||||
|
|
||||||
|
last_theme() {
|
||||||
|
theme.sh "$(theme.sh -l | tail -n2 | head -n1)"
|
||||||
|
}
|
||||||
|
|
||||||
|
zle -N last_theme
|
||||||
|
bindkey '^o' last_theme
|
||||||
|
|
||||||
|
alias th='theme.sh -i'
|
||||||
|
|
||||||
|
alias thl='theme.sh --light -i'
|
||||||
|
alias thd='theme.sh --dark -i'
|
||||||
|
fi
|
||||||
|
|
||||||
|
# vim: ft=zsh
|
||||||
Loading…
Reference in New Issue
Block a user