Add basic bootstrap routine
This commit is contained in:
parent
ed040d9caa
commit
7e0d5440d8
4 changed files with 86 additions and 23 deletions
|
@ -50,16 +50,16 @@ main() {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-s | --stow)
|
-s | --stow)
|
||||||
have_stow
|
have_stow
|
||||||
printf "Creating dotfile symlinks ........................\n"
|
echo "Creating dotfile symlinks ................................................."
|
||||||
stow_dirs
|
stow_dirs
|
||||||
printf "Done creating symlinks ...........................\n"
|
echo "Done creating symlinks ...................................................."
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
-d | --delete)
|
-d | --delete)
|
||||||
have_stow
|
have_stow
|
||||||
printf "Removing dotfile symlinks ........................\n"
|
echo "Removing dotfile symlinks ................................................."
|
||||||
unstow_dirs
|
unstow_dirs
|
||||||
printf "Done removing symlinks ...........................\n"
|
echo "Done removing symlinks ...................................................."
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
-h | --help | *)
|
-h | --help | *)
|
|
@ -7,13 +7,15 @@
|
||||||
# DESCRIPTION: Display usage information for this script.
|
# DESCRIPTION: Display usage information for this script.
|
||||||
# PARAMETERS: see usage function
|
# PARAMETERS: see usage function
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
|
packages="${BOOTSTRAP_PACKAGES:-packages.csv}"
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
local cmd=""
|
local cmd=""
|
||||||
local ret=0
|
local ret=0
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-v | --version)
|
-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)
|
-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"
|
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() {
|
install_packages() {
|
||||||
unattended="$1"
|
unattended="$1"
|
||||||
if "$unattended"; then
|
if "$unattended"; then
|
||||||
yay -Squ --noconfirm --needed - <packages.csv
|
yay -Squ --noconfirm --needed - <"$packages"
|
||||||
else
|
else
|
||||||
yay -Su --needed - <packages.csv
|
yay -Su --needed - <"$packages"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,12 +73,11 @@ check_consent() {
|
||||||
echo "Exiting."
|
echo "Exiting."
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
unattended=$1
|
unattended=$1
|
||||||
echo "Beginning boostrap ........................................................"
|
echo "Beginning package bootstrap ..............................................."
|
||||||
if ! "$unattended"; then
|
if ! "$unattended"; then
|
||||||
check_consent
|
check_consent
|
||||||
fi
|
fi
|
|
@ -4,10 +4,10 @@ bash
|
||||||
bibtool
|
bibtool
|
||||||
bison
|
bison
|
||||||
bzip2
|
bzip2
|
||||||
chromium
|
|
||||||
dhcpcd
|
dhcpcd
|
||||||
dialog
|
dialog
|
||||||
docker
|
docker
|
||||||
|
dunst
|
||||||
exa
|
exa
|
||||||
fasd
|
fasd
|
||||||
feh
|
feh
|
||||||
|
@ -15,26 +15,23 @@ flashfocus-git
|
||||||
fzf
|
fzf
|
||||||
gawk
|
gawk
|
||||||
git
|
git
|
||||||
|
git-lfs
|
||||||
gnome-keyring
|
gnome-keyring
|
||||||
gopass
|
gopass
|
||||||
grep
|
grep
|
||||||
gzip
|
gzip
|
||||||
hugo
|
hugo
|
||||||
i3-gaps
|
i3-gaps
|
||||||
i3blocks
|
|
||||||
i3lock
|
i3lock
|
||||||
i3status
|
|
||||||
jabref-latest
|
jabref-latest
|
||||||
|
jpdftweak
|
||||||
keybase-bin
|
keybase-bin
|
||||||
less
|
less
|
||||||
|
libnotify
|
||||||
libtool
|
libtool
|
||||||
littler
|
littler
|
||||||
logrotate
|
logrotate
|
||||||
mopidy
|
lynx
|
||||||
mopidy-podcast
|
|
||||||
mopidy-scrobbler
|
|
||||||
mopidy-spotify
|
|
||||||
mopidy-spotify-tunigo
|
|
||||||
mosh
|
mosh
|
||||||
mpv
|
mpv
|
||||||
nano
|
nano
|
||||||
|
@ -42,6 +39,7 @@ neovim
|
||||||
nerd-fonts-fira-code
|
nerd-fonts-fira-code
|
||||||
nerd-fonts-iosevka
|
nerd-fonts-iosevka
|
||||||
nextcloud-client
|
nextcloud-client
|
||||||
|
ntfs-3g
|
||||||
nvidia
|
nvidia
|
||||||
nvidia-utils
|
nvidia-utils
|
||||||
openssh
|
openssh
|
||||||
|
@ -49,9 +47,8 @@ os-prober
|
||||||
pacman
|
pacman
|
||||||
pandoc
|
pandoc
|
||||||
pandoc-citeproc
|
pandoc-citeproc
|
||||||
papis
|
|
||||||
picom
|
picom
|
||||||
pkgconf
|
playerctl
|
||||||
polybar
|
polybar
|
||||||
pulseaudio
|
pulseaudio
|
||||||
pulseaudio-alsa
|
pulseaudio-alsa
|
||||||
|
@ -59,7 +56,6 @@ pulsemixer
|
||||||
python-pip
|
python-pip
|
||||||
python-pybtex
|
python-pybtex
|
||||||
python-pynvim
|
python-pynvim
|
||||||
python-pywal
|
|
||||||
qutebrowser
|
qutebrowser
|
||||||
r
|
r
|
||||||
redshift
|
redshift
|
||||||
|
@ -70,8 +66,9 @@ rofi-dmenu
|
||||||
rofi-greenclip
|
rofi-greenclip
|
||||||
rofimoji
|
rofimoji
|
||||||
scrot
|
scrot
|
||||||
shellcheck-static
|
spotify
|
||||||
shfmt
|
sshfs
|
||||||
|
stow
|
||||||
surfraw
|
surfraw
|
||||||
sxhkd
|
sxhkd
|
||||||
tar
|
tar
|
||||||
|
@ -100,7 +97,6 @@ unzip
|
||||||
vagrant
|
vagrant
|
||||||
vifm
|
vifm
|
||||||
virtualbox
|
virtualbox
|
||||||
weechat
|
|
||||||
wget
|
wget
|
||||||
which
|
which
|
||||||
xcape
|
xcape
|
||||||
|
|
|
66
install.sh
Executable file
66
install.sh
Executable 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 "$@"
|
Loading…
Reference in a new issue