From afa79821cdd831b5b4ef8c7a8ed859b976e3bd73 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 11 Mar 2019 21:17:15 +0000 Subject: [PATCH] Resolve "Change shell to specified shell on installation" --- .config/bootstrap/install.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) mode change 100644 => 100755 .config/bootstrap/install.sh diff --git a/.config/bootstrap/install.sh b/.config/bootstrap/install.sh old mode 100644 new mode 100755 index a2be8e5..79cdb92 --- a/.config/bootstrap/install.sh +++ b/.config/bootstrap/install.sh @@ -6,15 +6,16 @@ ### OPTIONS AND VARIABLES ### # unset our temp variables, just in case they were used for something else in shell -unset pkgfiles dotfilesrepo targetuser targetpassword targetdeployment quietmode aurhelper +unset pkgfiles dotfilesrepo targetuser targetpassword targetdeployment quietmode aurhelper loginshell -while getopts ":a:r:p:u:U:f:F:hq" o; do case "${o}" in - h) printf "Optional arguments for custom use:\\n -r: Dotfiles repository (local file or url)\\n -p: Dependencies and programs csv (local file or url)\\n -a: AUR helper (must have pacman-like syntax)\\n -h: Show this message\\n" && exit ;; +while getopts ":a:r:f:F:t:s:h" o; do case "${o}" in + h) printf "Optional arguments for custom use:\\n -r: Dotfiles repository (local file or url)\\n -f: Dependencies and programs csv alongside defaults (local file or url)\\n -F: Dependencies and programs csv replacing defaults (local file or url)\\n -a: AUR helper (must have pacman-like syntax), defaults to yay\\n -t: Target deployment (laptop, desktop, headless, none) to set up relevant package function groups\\n -s: Default user shell. Must be a full path to the shell (/bin/zsh by default).\n -h: Show this message\\n" && exit ;; r) dotfilesrepo=${OPTARG} && git ls-remote "$dotfilesrepo" || exit ;; a) aurhelper=${OPTARG} ;; f) pkgfiles=${OPTARG} ;; F) pkgfiles=${OPTARG} && exclusivepkgfiles=true ;; t) targetdeployment=${OPTARG} ;; + s) loginshell=${OPTARG} ;; *) printf "Invalid option: -%s\\n" "$OPTARG" && exit ;; esac done @@ -22,6 +23,7 @@ esac done [ -z "$dotfilesrepo" ] && dotfilesrepo="https://gitlab.com/marty-oehme/dotfiles.git" [ -z "$pkgfiles" ] && pkgfiles="" [ -z "$aurhelper" ] && aurhelper="yay" +[ -z "$loginshell" ] && loginshell="/bin/zsh" ### FUNCTIONS ### @@ -255,6 +257,9 @@ installationloop $tmpfile putgitrepo "$dotfilesrepo" "/home/$name" rm "/home/$name/README.md" +# Set user login shell to desired shell - usually zsh +chsh -s $loginshell $name + # Pulseaudio, if/when initially installed, often needs a restart to work immediately. [ -f /usr/bin/pulseaudio ] && resetpulse