From 5b107f8eb85e60771b99288238ad40ba7bab568c Mon Sep 17 00:00:00 2001 From: Solomon Laing Date: Sun, 29 Aug 2021 15:43:54 +0930 Subject: [PATCH] minor changes --- install-config | 51 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/install-config b/install-config index 7af6b9a..d358c54 100755 --- a/install-config +++ b/install-config @@ -10,7 +10,7 @@ clear -echo "This script is going to install dmenu-inkletblot, my fork of dmenu with my custom styling. As such it will ask for root privilages." +echo "This script is going to install my dotfiles." read -r -p "Are You Sure? [y/N] " input @@ -27,5 +27,50 @@ case $input in ;; esac -cd dmenu-inkletblot -sudo -S make clean install +function config { + /usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@ +} + +git clone --bare https://gitlab.inkletblot.com/inkletblot/config.git $HOME/.cfg + +echo "The script will now attempt to install the configs, if configs have been installed using the method found here: https://www.atlassian.com/git/tutorials/dotfiles, there will be issues." + +echo "There are configs for laptops, my personal desktop, and a general config. Which would you like to intsall?" +echo "Standard, 1" +echo "Laptop (general), 2" +echo "Desktop (personal), 3" +read -r -p "Choose one (default=1): " choice + +case $choice in + 3) + checkout arch-desktop + ;; + 2) + checkout arch-laptop + ;; + *) + checkout main + ;; +esac + +if [ $? = 0 ]; then + echo "Checked out config."; +else + echo "Backing up pre-existing dot files."; + mkdir -p .config-backup + config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .config-backup/{} +fi; + +case $choice in + 3) + checkout arch-desktop + ;; + 2) + checkout arch-laptop + ;; + *) + checkout main + ;; +esac + +config config status.showUntrackedFiles no