Add basic bootstrap routine

This commit is contained in:
Marty Oehme 2019-12-30 10:20:17 +01:00
parent ed040d9caa
commit 7e0d5440d8
4 changed files with 86 additions and 23 deletions

View file

@ -50,16 +50,16 @@ main() {
case "$1" in
-s | --stow)
have_stow
printf "Creating dotfile symlinks ........................\n"
echo "Creating dotfile symlinks ................................................."
stow_dirs
printf "Done creating symlinks ...........................\n"
echo "Done creating symlinks ...................................................."
exit 0
;;
-d | --delete)
have_stow
printf "Removing dotfile symlinks ........................\n"
echo "Removing dotfile symlinks ................................................."
unstow_dirs
printf "Done removing symlinks ...........................\n"
echo "Done removing symlinks ...................................................."
exit 0
;;
-h | --help | *)

View file

@ -7,13 +7,15 @@
# DESCRIPTION: Display usage information for this script.
# PARAMETERS: see usage function
#==============================================================================
packages="${BOOTSTRAP_PACKAGES:-packages.csv}"
main() {
local cmd=""
local ret=0
case "$1" in
-v | --version)
printf "Package bootstrap script.\n\n©Marty Oehme\n\nVersion: 0.1\n"
printf "Package bootstrap script.\n\n©Marty Oehme\n\nVersion: 0.3\n"
;;
-h | --help)
printf "Usage: install [-f|--force][-v|--version][-h|--help]\n\n-f Do not ask for any confirmations but force update and installation.\n"
@ -58,9 +60,9 @@ update_repos() {
install_packages() {
unattended="$1"
if "$unattended"; then
yay -Squ --noconfirm --needed - <packages.csv
yay -Squ --noconfirm --needed - <"$packages"
else
yay -Su --needed - <packages.csv
yay -Su --needed - <"$packages"
fi
}
@ -71,12 +73,11 @@ check_consent() {
echo "Exiting."
exit
fi
}
install() {
unattended=$1
echo "Beginning boostrap ........................................................"
echo "Beginning package bootstrap ..............................................."
if ! "$unattended"; then
check_consent
fi

View file

@ -4,10 +4,10 @@ bash
bibtool
bison
bzip2
chromium
dhcpcd
dialog
docker
dunst
exa
fasd
feh
@ -15,26 +15,23 @@ flashfocus-git
fzf
gawk
git
git-lfs
gnome-keyring
gopass
grep
gzip
hugo
i3-gaps
i3blocks
i3lock
i3status
jabref-latest
jpdftweak
keybase-bin
less
libnotify
libtool
littler
logrotate
mopidy
mopidy-podcast
mopidy-scrobbler
mopidy-spotify
mopidy-spotify-tunigo
lynx
mosh
mpv
nano
@ -42,6 +39,7 @@ neovim
nerd-fonts-fira-code
nerd-fonts-iosevka
nextcloud-client
ntfs-3g
nvidia
nvidia-utils
openssh
@ -49,9 +47,8 @@ os-prober
pacman
pandoc
pandoc-citeproc
papis
picom
pkgconf
playerctl
polybar
pulseaudio
pulseaudio-alsa
@ -59,7 +56,6 @@ pulsemixer
python-pip
python-pybtex
python-pynvim
python-pywal
qutebrowser
r
redshift
@ -70,8 +66,9 @@ rofi-dmenu
rofi-greenclip
rofimoji
scrot
shellcheck-static
shfmt
spotify
sshfs
stow
surfraw
sxhkd
tar
@ -100,7 +97,6 @@ unzip
vagrant
vifm
virtualbox
weechat
wget
which
xcape

1 alacritty
4 bibtool
5 bison
6 bzip2
chromium
7 dhcpcd
8 dialog
9 docker
10 dunst
11 exa
12 fasd
13 feh
15 fzf
16 gawk
17 git
18 git-lfs
19 gnome-keyring
20 gopass
21 grep
22 gzip
23 hugo
24 i3-gaps
i3blocks
25 i3lock
i3status
26 jabref-latest
27 jpdftweak
28 keybase-bin
29 less
30 libnotify
31 libtool
32 littler
33 logrotate
34 mopidy lynx
mopidy-podcast
mopidy-scrobbler
mopidy-spotify
mopidy-spotify-tunigo
35 mosh
36 mpv
37 nano
39 nerd-fonts-fira-code
40 nerd-fonts-iosevka
41 nextcloud-client
42 ntfs-3g
43 nvidia
44 nvidia-utils
45 openssh
47 pacman
48 pandoc
49 pandoc-citeproc
papis
50 picom
51 pkgconf playerctl
52 polybar
53 pulseaudio
54 pulseaudio-alsa
56 python-pip
57 python-pybtex
58 python-pynvim
python-pywal
59 qutebrowser
60 r
61 redshift
66 rofi-greenclip
67 rofimoji
68 scrot
69 shellcheck-static spotify
70 shfmt sshfs
71 stow
72 surfraw
73 sxhkd
74 tar
97 vagrant
98 vifm
99 virtualbox
weechat
100 wget
101 which
102 xcape

66
install.sh Executable file
View file

@ -0,0 +1,66 @@
#!/usr/bin/env bash
#
# install.sh
#
# Installs dotfiles and packages for my setup
#
# Will first install yay, then all my used packages (read from bootstrap/packages.csv)
#
# Will symlink all my dotfiles into their correct places using autostow.sh
main() {
local cmd=""
local ret=0
case "$1" in
-v | --version)
printf "Personal system bootstrap script.\n\n©Marty Oehme\n\nVersion: 0.1\n"
;;
-h | --help)
printf "Usage: install [-f|--force][-v|--version][-h|--help]\n\n-f Do not ask for any confirmations but force update and installation.\n"
;;
-f | --force)
install true
;;
*)
install false
;;
esac
shift
$cmd "$@"
ret=$((ret + $?))
exit $ret
}
check_consent() {
echo "This will take a while, install many packages and link dotfiles all over the place. Proceed [y/N]?"
read -r yes
if [[ "$yes" != y* ]]; then
echo "Exiting."
exit
fi
}
install() {
unattended=$1
if ! "$unattended"; then
check_consent
fi
echo "====================== BEGINNING INSTALLATION ============================="
if ! "$unattended"; then
export BOOTSTRAP_PACKAGES="bootstrap/.config/bootstrap/packages.csv"
./bootstrap/.config/bootstrap/install_packages.sh
else
export BOOTSTRAP_PACKAGES="bootstrap/.config/bootstrap/packages.csv"
./bootstrap/.config/bootstrap/install_packages.sh -f
fi
echo "=================== BEGINNING DOTFILE MANAGEMENT =========================="
./bootstrap/.config/bootstrap/autostow.sh -s
echo "====================== INSTALLATION FINISHED =============================="
}
main "$@"