aboutsummaryrefslogtreecommitdiff
path: root/new-user-setup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'new-user-setup.sh')
-rwxr-xr-xnew-user-setup.sh126
1 files changed, 91 insertions, 35 deletions
diff --git a/new-user-setup.sh b/new-user-setup.sh
index 18d020a..adac48b 100755
--- a/new-user-setup.sh
+++ b/new-user-setup.sh
@@ -47,22 +47,57 @@ ENDCOLOR="\e[0m"
47echo "### Starting dotfiles.core installation... ###" 47echo "### Starting dotfiles.core installation... ###"
48 48
49# Warn user about dependencies 49# Warn user about dependencies
50echo "" 50echo -e "${WARN}WARNING: This installer assumes dotfiles.sys and sys-level packages have been installed. [A]bort, [C]ontinue: ${ENDCOLOR}"
51echo "${WARN}WARNING: This installer assumes that dotfiles.sys and all sys-level packages have been installed.${ENDCOLOR}"
52echo "[A]bort, [C]ontinue"
53echo -en "\033[1A\033[1000C" 51echo -en "\033[1A\033[1000C"
54read -n1 confirm 52read -n1 confirm
53confirm_invalid_selection=0
55while 54while
56 case $confirm in 55 case $confirm in
57 "a"|"A") 56 "a"|"A")
57 echo "INFO : Abort!"
58 exit 0;; 58 exit 0;;
59 "c"|"C") 59 "c"|"C")
60 break;; 60 break;;
61 *) 61 *)
62 echo -e "${WARN}ERROR : Invalid selection, try again...${ENDCOLOR}" 62 echo -e "${WARN}ERROR : Invalid selection, try again...${ENDCOLOR}"
63 invalid_selection=1;; 63 confirm_invalid_selection=1;;
64 esac 64 esac
65 [[ $invalid_selection==1 ]] 65 [[ $confirm_invalid_selection==1 ]]
66do true; done
67
68
69########################################################################
70## Install Packages
71########################################################################
72echo "INFO : Proceed with package installation? Requires sudo privileges [y/n]: "
73echo -en "\033[1A\033[1000C"
74read -n1 do_package_install
75package_invalid_selection=0
76while
77 case $do_package_install in
78 "y"|"Y")
79 sudo pkg update
80 sudo pkg upgrade && sudo pkg install \
81 audio/dsbmixer \
82 audio/gtk-mixer \
83 graphics/drm-kmod \
84 graphics/ImageMagick7 \
85 graphics/poppler-glib \
86 mail/isync \
87 www/firefox \
88 x11/arandr \
89 x11-fonts/nerd-fonts \
90 x11/xorg
91 echo "INFO : Packages installed and updated."
92 break;;
93 "n"|"N")
94 echo "INFO : Skipping package installation and updates."
95 break;;
96 *)
97 echo -e "${WARN}ERROR : Invalid selection, try again...${ENDCOLOR}"
98 package_invalid_selection=1;;
99 esac
100 [[ $package_invalid_selection==1 ]]
66do true; done 101do true; done
67 102
68 103
@@ -164,36 +199,57 @@ place_directory () {
164 fi 199 fi
165} 200}
166 201
167# Create user dir skeleton 202# Place files
168place_directory $HOME/bin 203echo "INFO : Proceed with dotfiles installation? [y/n]: "
169 204echo -en "\033[1A\033[1000C"
170# Bash Configuration 205read -n1 do_dotfiles_install
171place_file $HOME/dotfiles.core/home/.bash_profile $HOME/.bash_profile 206dotfiles_invalid_selection=0
172place_file $HOME/dotfiles.core/home/.bashrc $HOME/.bashrc 207while
173place_file $HOME/dotfiles.core/home/.bash_aliases $HOME/.bash_aliases 208 case $do_dotfiles_install in
174 209 "y"|"Y")
175# GPG Configuration 210 # Create user dir skeleton
176place_directory $HOME/.gnupg/ 211 place_directory $HOME/bin
177place_file $HOME/dotfiles.core/home/.gnupg/gpg-agent.conf $HOME/.gnupg/gpg-agent.conf 212
178 213 # Bash Configuration
179# Git configuration 214 place_file $HOME/dotfiles.core/home/.bash_profile $HOME/.bash_profile
180place_file $HOME/dotfiles.core/home/.gitconfig $HOME/.gitconfig 215 place_file $HOME/dotfiles.core/home/.bashrc $HOME/.bashrc
181echo -e "${WARN}WARNING: ~/.gitconfig.local should be placed manually${ENDCOLOR}" 216 place_file $HOME/dotfiles.core/home/.bash_aliases $HOME/.bash_aliases
182 217
183# Common Lisp SBCL Configuration 218 # GPG Configuration
184place_file $HOME/dotfiles.core/home/.sbclrc $HOME/.sbclrc 219 place_directory $HOME/.gnupg/
185place_directory $HOME/lisp 220 place_file $HOME/dotfiles.core/home/.gnupg/gpg-agent.conf $HOME/.gnupg/gpg-agent.conf
186# Install Quicklisp 221
187if [[ ! -d $HOME/lisp/quicklisp ]]; then 222 # Git configuration
188 curl -o /tmp/ql.lisp http://beta.quicklisp.org/quicklisp.lisp 223 place_file $HOME/dotfiles.core/home/.gitconfig $HOME/.gitconfig
189 sbcl --no-sysinit --no-userinit --load /tmp/ql.lisp \ 224 echo -e "${WARN}WARNING: ~/.gitconfig.local should be placed manually${ENDCOLOR}"
190 --eval '(quicklisp-quickstart:install :path "~/lisp/quicklisp")' \ 225
191 --quit \ 226 # Common Lisp SBCL Configuration
192 > /dev/null # minimize output 227 place_file $HOME/dotfiles.core/home/.sbclrc $HOME/.sbclrc
193 echo -e "${GREEN}INFO : Installed Quicklisp${ENDCOLOR}" 228 place_directory $HOME/lisp
194else 229 # Install Quicklisp
195 echo -e "${YELLOW}Skipped: Quicklisp. Already installed${ENDCOLOR}" 230 if [[ ! -d $HOME/lisp/quicklisp ]]; then
196fi 231 curl -o /tmp/ql.lisp http://beta.quicklisp.org/quicklisp.lisp
232 sbcl --no-sysinit --no-userinit --load /tmp/ql.lisp \
233 --eval '(quicklisp-quickstart:install :path "~/lisp/quicklisp")' \
234 --quit \
235 > /dev/null # minimize output
236 echo -e "${GREEN}INFO : Installed Quicklisp${ENDCOLOR}"
237 else
238 echo -e "${YELLOW}Skipped: Quicklisp. Already installed${ENDCOLOR}"
239 fi
240 echo "INFO : Configuration files placed!"
241 break;;
242 "n"|"N")
243 echo "INFO : Skipping configuration file placement."
244 break;;
245 *)
246 echo -e "${WARN}ERROR : Invalid selection, try again...${ENDCOLOR}"
247 dotfiles_invalid_selection=1;;
248 esac
249 [[ $dotfiles_invalid_selection=1 ]]
250do true; done
251
252
197 253
198######################################################################## 254########################################################################
199## END OF SCRIPT 255## END OF SCRIPT