|
|
|
@ -20,18 +20,19 @@ function noyes() { |
|
|
|
|
|
|
|
|
|
|
|
function theme_preview() { |
|
|
|
function theme_preview() { |
|
|
|
THEME=$1 |
|
|
|
THEME=$1 |
|
|
|
|
|
|
|
THEME_NAME=`echo $THEME | sed s/\.zsh-theme//` |
|
|
|
export ZDOTDIR="$(mktemp -d tmp.zshXXXX)" |
|
|
|
export ZDOTDIR="$(mktemp -d tmp.zshXXXX)" |
|
|
|
|
|
|
|
|
|
|
|
cat <<-EOF >"$ZDOTDIR/.zshrc" |
|
|
|
cat <<-EOF >"$ZDOTDIR/.zshrc" |
|
|
|
source ~/.zshrc |
|
|
|
ZSH_THEME="$THEME_NAME" |
|
|
|
source "$THEMES_DIR/$THEME" |
|
|
|
source $ZSH/oh-my-zsh.sh |
|
|
|
EOF |
|
|
|
EOF |
|
|
|
zsh |
|
|
|
zsh |
|
|
|
rm -rf "$ZDOTDIR" |
|
|
|
rm -rf "$ZDOTDIR" |
|
|
|
|
|
|
|
|
|
|
|
echo |
|
|
|
echo |
|
|
|
noyes "Do you want to add it to your favourite list ($FAVLIST)?" || \ |
|
|
|
noyes "Do you want to add it to your favourite list ($FAVLIST)?" || \ |
|
|
|
echo $THEME >> $FAVLIST |
|
|
|
echo $THEME_NAME >> $FAVLIST |
|
|
|
echo |
|
|
|
echo |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|