mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
allow changetheme to take a theme name
This commit is contained in:
parent
fe416f56fc
commit
8a577e77af
1 changed files with 23 additions and 19 deletions
|
|
@ -21,26 +21,30 @@ function usetheme() {
|
||||||
|
|
||||||
# Change themes through a menu style prompt
|
# Change themes through a menu style prompt
|
||||||
function changetheme() {
|
function changetheme() {
|
||||||
theme_files=($ZSH_THEMES_PATH/*)
|
if [ $1 ]; then
|
||||||
theme_names=(${${theme_files[@]##*/}[@]%.zsh-theme})
|
usetheme "$1"
|
||||||
|
else
|
||||||
|
theme_files=($ZSH_THEMES_PATH/*)
|
||||||
|
theme_names=(${${theme_files[@]##*/}[@]%.zsh-theme})
|
||||||
|
|
||||||
PS3="Enter your selection: "
|
PS3="Enter your selection: "
|
||||||
SELECTION=""
|
SELECTION=""
|
||||||
|
|
||||||
echo "Themes available:"
|
echo "Themes available:"
|
||||||
select theme in ${theme_names[@]} Quit
|
select theme in ${theme_names[@]} Quit
|
||||||
do
|
do
|
||||||
case $theme in
|
case $theme in
|
||||||
Quit)
|
Quit)
|
||||||
echo "Exiting... "
|
echo "Exiting... "
|
||||||
exit;;
|
exit;;
|
||||||
*)
|
*)
|
||||||
SELECTION=$REPLY
|
SELECTION=$REPLY
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
theme="${theme_names[$SELECTION]}"
|
theme="${theme_names[$SELECTION]}"
|
||||||
usetheme $theme
|
usetheme $theme
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue