Resolve "Change shell to specified shell on installation"

This commit is contained in:
Marty Oehme 2019-03-11 21:17:15 +00:00
parent 2ead9a76c4
commit afa79821cd

11
.config/bootstrap/install.sh Normal file → Executable file
View file

@ -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