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
|
||||
function changetheme() {
|
||||
theme_files=($ZSH_THEMES_PATH/*)
|
||||
theme_names=(${${theme_files[@]##*/}[@]%.zsh-theme})
|
||||
if [ $1 ]; then
|
||||
usetheme "$1"
|
||||
else
|
||||
theme_files=($ZSH_THEMES_PATH/*)
|
||||
theme_names=(${${theme_files[@]##*/}[@]%.zsh-theme})
|
||||
|
||||
PS3="Enter your selection: "
|
||||
SELECTION=""
|
||||
PS3="Enter your selection: "
|
||||
SELECTION=""
|
||||
|
||||
echo "Themes available:"
|
||||
select theme in ${theme_names[@]} Quit
|
||||
do
|
||||
case $theme in
|
||||
Quit)
|
||||
echo "Exiting... "
|
||||
exit;;
|
||||
*)
|
||||
SELECTION=$REPLY
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
echo "Themes available:"
|
||||
select theme in ${theme_names[@]} Quit
|
||||
do
|
||||
case $theme in
|
||||
Quit)
|
||||
echo "Exiting... "
|
||||
exit;;
|
||||
*)
|
||||
SELECTION=$REPLY
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
theme="${theme_names[$SELECTION]}"
|
||||
usetheme $theme
|
||||
theme="${theme_names[$SELECTION]}"
|
||||
usetheme $theme
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue