2012-06-22 17:25:44 +00:00
|
|
|
function theme
|
|
|
|
{
|
2013-10-28 15:06:10 +00:00
|
|
|
if [ -z "$1" ] || [ "$1" = "random" ]; then
|
2015-10-08 00:37:25 +00:00
|
|
|
themes=($ZSH/themes/*zsh-theme)
|
|
|
|
N=${#themes[@]}
|
|
|
|
((N=(RANDOM%N)+1))
|
|
|
|
RANDOM_THEME=${themes[$N]}
|
|
|
|
source "$RANDOM_THEME"
|
|
|
|
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
|
2012-06-22 17:25:44 +00:00
|
|
|
else
|
2015-10-08 00:37:25 +00:00
|
|
|
if [ -f "$ZSH_CUSTOM/$1.zsh-theme" ]; then
|
|
|
|
source "$ZSH_CUSTOM/$1.zsh-theme"
|
|
|
|
elif [ -f "$ZSH_CUSTOM/themes/$1.zsh-theme" ]; then
|
|
|
|
source "$ZSH_CUSTOM/themes/$1.zsh-theme"
|
|
|
|
else
|
|
|
|
source "$ZSH/themes/$1.zsh-theme"
|
|
|
|
fi
|
2012-06-22 17:25:44 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function lstheme
|
|
|
|
{
|
|
|
|
cd $ZSH/themes
|
|
|
|
ls *zsh-theme | sed 's,\.zsh-theme$,,'
|
|
|
|
}
|