mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-13 20:28:35 +10:00
Adding choose-shell script
This commit is contained in:
46
.local/bin/choose-shell
Executable file
46
.local/bin/choose-shell
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
BOLD='\e[1m'
|
||||
GREEN='\e[92m'
|
||||
YELLOW='\e[93m'
|
||||
RESET='\e[0m'
|
||||
|
||||
print_info () {
|
||||
echo -ne "${BOLD}${YELLOW}$1${RESET}\n"
|
||||
}
|
||||
|
||||
print_choice () {
|
||||
echo -ne "${BOLD}${GREEN}>> $1${RESET}\n\n"
|
||||
}
|
||||
|
||||
print_info "Choose your user's default shell:"
|
||||
echo "1. /bin/bash"
|
||||
echo "2. /bin/fish"
|
||||
echo "3. /bin/zsh"
|
||||
|
||||
read -p "Enter the number of your preferred shell: " choice
|
||||
|
||||
case $choice in
|
||||
1)
|
||||
chsh -s /bin/bash
|
||||
print_choice "Shell choice: /bin/bash"
|
||||
printf '%s\n' "If default shell was changed, you will need to logout and
|
||||
log back in for change to take effect."
|
||||
;;
|
||||
2)
|
||||
chsh -s /bin/fish
|
||||
print_choice "Shell choice: /bin/fish"
|
||||
printf '%s\n' "If default shell was changed, you will need to logout and
|
||||
log back in for change to take effect."
|
||||
;;
|
||||
3)
|
||||
chsh -s /bin/zsh
|
||||
print_choice "Shell choice: /bin/zsh"
|
||||
printf '%s' "If default shell was changed, you will need to logout and
|
||||
log back in fo\nr change to take effect."
|
||||
;;
|
||||
*)
|
||||
echo "Invalid choice. Please try again."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user