mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Swapped out ZSH_THEME for two functions, set_theme and random_theme. At the moment I dropped ZSH_THEME variable too. Auto completion to come. Function makes it easier to change themes on-the-fly.
This commit is contained in:
parent
00f5e827d2
commit
a812654cbe
1 changed files with 8 additions and 15 deletions
21
oh-my-zsh.sh
21
oh-my-zsh.sh
|
|
@ -40,19 +40,12 @@ done
|
||||||
# Load all of your custom configurations from custom/
|
# Load all of your custom configurations from custom/
|
||||||
for config_file ($ZSH_CUSTOM/*.zsh) source $config_file
|
for config_file ($ZSH_CUSTOM/*.zsh) source $config_file
|
||||||
|
|
||||||
# Load the theme
|
set_theme() {
|
||||||
if [ "$ZSH_THEME" = "random" ]
|
|
||||||
then
|
|
||||||
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..."
|
|
||||||
else
|
|
||||||
if [ ! "$ZSH_THEME" = "" ]
|
|
||||||
then
|
|
||||||
source "$ZSH/themes/$ZSH_THEME.zsh-theme"
|
source "$ZSH/themes/$ZSH_THEME.zsh-theme"
|
||||||
fi
|
}
|
||||||
fi
|
|
||||||
|
|
||||||
|
random_theme() {
|
||||||
|
local themes
|
||||||
|
themes=($ZSH/themes/*zsh-theme)
|
||||||
|
source "$themes[$RANDOM%$#themes+1]"
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue