ink-os/install-config
2021-08-29 15:43:54 +09:30

77 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
#-----------------------------------
# Name: install-dmenu-inkletblot
# Version: 1.0.0
# Author: Solomon Laing
# Description:
# Installs my customisation of dmenu
#-----------------------------------
clear
echo "This script is going to install my dotfiles."
read -r -p "Are You Sure? [y/N] " input
case $input in
[yY][eE][sS] | [yY])
echo "The program will continue..."
;;
[nN][oO] | [nN])
exit 0
;;
*)
echo "Invalid input..."
exit 1
;;
esac
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