Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
0c28e392
Commit
0c28e392
authored
Nov 01, 2017
by
Robby Russell
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Gnouc-Random_Theme_From_List'
parents
57742ccd
a1d13aa0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
2 deletions
+21
-2
README.md
README.md
+8
-0
oh-my-zsh.sh
oh-my-zsh.sh
+6
-2
zshrc.zsh-template
templates/zshrc.zsh-template
+7
-0
No files found.
README.md
View file @
0c28e392
...
...
@@ -96,6 +96,14 @@ If you're feeling feisty, you can let the computer select one randomly for you e
ZSH_THEME="random" # (...please let it be pie... please be some pie..)
```
And if you want to pick random theme from a list of your favorite themes:
```
shell
ZSH_THEM_RANDOM_CANDIDATES
=(
"robbyrussell"
"agnoster"
)
```
## Advanced Topics
...
...
oh-my-zsh.sh
View file @
0c28e392
...
...
@@ -93,8 +93,12 @@ done
unset
config_file
# Load the theme
if
[
"
$ZSH_THEME
"
=
"random"
]
;
then
themes
=(
$ZSH
/themes/
*
zsh-theme
)
if
[[
"
$ZSH_THEME
"
==
"random"
]]
;
then
if
[[
"
${
(t)ZSH_THEME_RANDOM_CANDIDATES
}
"
=
"array"
]]
&&
[[
"
${#
ZSH_THEME_RANDOM_CANDIDATES
[@]
}
"
-gt
0
]]
;
then
themes
=(
$ZSH
/themes/
${
^ZSH_THEME_RANDOM_CANDIDATES
}
.zsh-theme
)
else
themes
=(
$ZSH
/themes/
*
zsh-theme
)
fi
N
=
${#
themes
[@]
}
((
N
=(
RANDOM%N
)
+1
))
RANDOM_THEME
=
${
themes
[
$N
]
}
...
...
templates/zshrc.zsh-template
View file @
0c28e392
...
...
@@ -9,6 +9,13 @@ export ZSH=$HOME/.oh-my-zsh
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"
# Set list of themes to load
# Setting this variable when ZSH_THEME=random
# cause zsh load theme from this variable instead of
# looking in ~/.oh-my-zsh/themes/
# An empty array have no effect
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment