mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
oh-my-bash: support OMB_THEME_RANDOM_SELECTED for the selected theme name
This commit is contained in:
@@ -94,11 +94,16 @@ In case you did not find a suitable theme for your needs, please have a look at
|
|||||||
|
|
||||||
If you're feeling feisty, you can let the computer select one randomly for you each time you open a new terminal window.
|
If you're feeling feisty, you can let the computer select one randomly for you each time you open a new terminal window.
|
||||||
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
OSH_THEME="random" # (...please let it be pie... please be some pie..)
|
OSH_THEME="random" # (...please let it be pie... please be some pie..)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The selected theme name can be checked by the following command:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ echo "$OMB_THEME_RANDOM_SELECTED"
|
||||||
|
```
|
||||||
|
|
||||||
## Advanced Topics
|
## Advanced Topics
|
||||||
|
|
||||||
If you're the type that likes to get their hands dirty, these sections might resonate.
|
If you're the type that likes to get their hands dirty, these sections might resonate.
|
||||||
|
@@ -134,7 +134,10 @@ if [[ $OSH_THEME == random ]]; then
|
|||||||
if ((${#_omb_init_files[@]})); then
|
if ((${#_omb_init_files[@]})); then
|
||||||
_omb_init_file=${_omb_init_files[RANDOM%${#_omb_init_files[@]}]}
|
_omb_init_file=${_omb_init_files[RANDOM%${#_omb_init_files[@]}]}
|
||||||
source "$_omb_init_file"
|
source "$_omb_init_file"
|
||||||
echo "[oh-my-bash] Random theme '$_omb_init_file' loaded..."
|
OMB_THEME_RANDOM_SELECTED=${_omb_init_file##*/}
|
||||||
|
OMB_THEME_RANDOM_SELECTED=${OMB_THEME_RANDOM_SELECTED%.theme.bash}
|
||||||
|
OMB_THEME_RANDOM_SELECTED=${OMB_THEME_RANDOM_SELECTED%.theme.sh}
|
||||||
|
echo "[oh-my-bash] Random theme '$OMB_THEME_RANDOM_SELECTED' ($_omb_init_file) loaded..."
|
||||||
fi
|
fi
|
||||||
unset -v _omb_init_files _omb_init_file
|
unset -v _omb_init_files _omb_init_file
|
||||||
elif [[ $OSH_THEME ]]; then
|
elif [[ $OSH_THEME ]]; then
|
||||||
|
Reference in New Issue
Block a user