Add basic bootstrap routine
This commit is contained in:
parent
ed040d9caa
commit
7e0d5440d8
4 changed files with 86 additions and 23 deletions
73
bootstrap/.config/bootstrap/autostow.sh
Executable file
73
bootstrap/.config/bootstrap/autostow.sh
Executable file
|
|
@ -0,0 +1,73 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# autostow.sh
|
||||
#
|
||||
# Stow automatic symlinking script
|
||||
#
|
||||
# Invokes stow for every folder within this repository, and that's it.
|
||||
|
||||
stow_dirs() {
|
||||
for d in */; do
|
||||
printf "stowing %s\n" "$d"
|
||||
stow -S -t ~ "$d"
|
||||
done
|
||||
}
|
||||
|
||||
unstow_dirs() {
|
||||
for d in */; do
|
||||
printf "unstowing %s\n" "$d"
|
||||
stow -D -t ~ "$d"
|
||||
done
|
||||
}
|
||||
|
||||
have_stow() {
|
||||
if ! type stow >/dev/null 2>&1; then
|
||||
printf "GNU stow needs to be installed for this script to function. Please install stow through your package manager.\n"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
usage() {
|
||||
printf "%s\n" \
|
||||
"" \
|
||||
" autostow.sh - Automatically stow your dotfiles." \
|
||||
" Uses GNU stow to set up automatic links to any dotfiles in subdirectories of this directory." \
|
||||
"" \
|
||||
" Usage: stow.sh -dhs" \
|
||||
"" \
|
||||
" Options:" \
|
||||
"" \
|
||||
" -h Print out this help." \
|
||||
"" \
|
||||
" -s Install dotfiles, by symlinking any directory found next to stow.sh using GNU stow." \
|
||||
"" \
|
||||
" -d Remove dotfiles, by unlinking any directory found next to stow.sh using GNU stow." \
|
||||
"" \
|
||||
""
|
||||
}
|
||||
|
||||
main() {
|
||||
case "$1" in
|
||||
-s | --stow)
|
||||
have_stow
|
||||
echo "Creating dotfile symlinks ................................................."
|
||||
stow_dirs
|
||||
echo "Done creating symlinks ...................................................."
|
||||
exit 0
|
||||
;;
|
||||
-d | --delete)
|
||||
have_stow
|
||||
echo "Removing dotfile symlinks ................................................."
|
||||
unstow_dirs
|
||||
echo "Done removing symlinks ...................................................."
|
||||
exit 0
|
||||
;;
|
||||
-h | --help | *)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
Loading…
Add table
Add a link
Reference in a new issue