Add distro auto-install

This feature should make initial setup a /little/ faster.
If the user accepts the install prompt, the approiate install
script for the current distro will be downloaded and ran.

Assumes the user has sudo access and has read the script contents
beforehand.
This commit is contained in:
David Todd (c0de) 2018-10-23 00:08:59 -05:00
parent d9b7ae42a8
commit 5303a7077a
4 changed files with 51 additions and 0 deletions

15
.bin/install.arch Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
# This ensures that the entire script is downloaded before execution
{
pacman -Syu
pacman -S yay
yay -Syu
yay -S tmux zsh vim git\
terminator rofi feh xcompmgr\
i3lock-fancy i3blocks
}

13
.bin/install.deb Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# This ensures that the entire script is downloaded before execution
{
sudo apt update
sudo apt upgrade
sudo apt install tmux zsh vim git\
terminator rofi feh xcompmgr\
i3lock-fancy i3blocks
}

View File

@ -7,6 +7,13 @@
3. ????
4. Profit
## Distro auto-install
This feature will install the basic dependencies automatically if you approve at the prompt, assumes that you have sudo access.
Currently available for:
- Arch/Manjaro Linux (pacman+yay)
- Debian Linux (apt)
## Dotfiles Postinstall
You may create a standard text file called `.dotfiles.postinst` in your home directory before installing.
This file contains commands, one per line, that will be executed in order after the install script finishes.

View File

@ -39,6 +39,22 @@ function symlink() {
read -p "Press enter to install my dotfiles " WAIT_FOR_INPUT
echo "[Dotfiles] Would you like to detect distro and auto-install dependencies? [Y/n]: \c"
read line
if [[ "$line" == Y* ]] || [[ "$line" == y* ]] || [ -z "$line" ]; then
distrourl="https://raw.githubusercontent.com/alopexc0de/dotfiles/master/.bin"
if [ -f /etc/arch-release ]; then
bash <(curl -sL $distrourl/install.deb)
elif [ -f /etc/debian_version]; then
bash <(curl -sL $distrourl/install.arch)
else
echo "This system does not have an auto-install file. Please install the following packages manually"
echo "- tmux zsh vim git"
echo "- terminator rofi feh xcompmgr"
echo "- i3lock-fancy i3blocks"
fi
fi
if ! which git >>/dev/null ; then
echo "Error: git is not installed"
exit 1