From ed8b3a1e41998530e5ee411395f27962e8760b76 Mon Sep 17 00:00:00 2001 From: Derek Taylor Date: Wed, 21 May 2025 15:43:03 -0500 Subject: [PATCH] Adding choose-shell script --- .local/bin/choose-shell | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 .local/bin/choose-shell diff --git a/.local/bin/choose-shell b/.local/bin/choose-shell new file mode 100755 index 0000000..32d9507 --- /dev/null +++ b/.local/bin/choose-shell @@ -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