dotfiles/setup.sh

93 lines
3.4 KiB
Bash
Raw Normal View History

2023-11-14 10:48:40 +00:00
#!/usr/bin/env bash
2023-11-21 15:16:47 +00:00
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
2023-11-14 10:48:40 +00:00
echo '
-------------------------------------------------------------
_ _ _ _ ____ _ _____ _ _
| \ | (_) | ___ _ ___| _ \ ___ | |_| ___(_) | ___ ___
| \| | | |/ / | | / __| | | |/ _ \| __| |_ | | |/ _ \/ __|
| |\ | | <| |_| \__ \ |_| | (_) | |_| _| | | | __/\__ \
|_| \_|_|_|\_\\__,_|___/____/ \___/ \__|_| |_|_|\___||___/
Dirty Setup Script for this glorious Dotfiles
-------------------------------------------------------------'
if type -p apt > /dev/null
then
echo 'Debian/Ubuntu'
2023-11-21 15:16:47 +00:00
PKG_MNGR="apt"
2023-11-14 10:48:40 +00:00
elif type -p dnf > /dev/null
then
echo 'RHEL/Fedora'
2023-11-21 15:16:47 +00:00
PKG_MNGR="dnf"
fi
echo '
-------------------------------------------------------------
Install hard dependencies golang, jq
-------------------------------------------------------------'
if [ "$PKG_MNGR" = "apt" ]
then
sudo apt-get update > /dev/null && sudo apt-get install golang jq
elif [ "$PKG_MNGR" = "dnf" ]
then
sudo dnf install golang jq
else
echo "No Package Manager configured, couldn't install"
fi
if ! type -p go > /dev/null
then
echo '-------------------------------------------------------------'
echo "Couldn't install go qwq... Aborting the script"
echo '-------------------------------------------------------------'
exit 1
2023-11-14 10:48:40 +00:00
fi
echo '
-------------------------------------------------------------
Install Gum for a pretty CLI Experience
-------------------------------------------------------------'
2023-11-21 15:16:47 +00:00
go install github.com/charmbracelet/gum@latest > /dev/null
if ! type -p gum > /dev/null
then
echo '-------------------------------------------------------------'
echo "Couldn't install gum qwq... Aborting the script"
echo '-------------------------------------------------------------'
exit 1
fi
2023-11-14 10:48:40 +00:00
gum style --border rounded --margin '1 2' --padding '2 4' --align center --foreground '#5BCEFA' --border-foreground '#F5A9B8' 'Gum is now installed' 'yay :3'
2023-11-21 15:16:47 +00:00
echo "Niku perfers to use the fish shell, but the design of the dotfiles (starship) works with nearly any shell, do you want to switch to fish"
WANTS_FISH=$(gum choose "Yes" "No")
if [ "$WANTS_FISH" = "Yes" ]
then
if [ "$PKG_MNGR" = "apt" ]
then
sudo apt-get update > /dev/null && sudo apt-get install fish
elif [ "$PKG_MNGR" = "dnf" ]
then
sudo dnf install fish
else
echo "No Package Manager configured, couldn't install"
fi
fi
gum style --border rounded --margin '1 1' --padding '1 1' --align center --foreground '#5BCEFA' --border-foreground '#F5A9B8' 'Do you want to install nikus fish config'
WANTS_SHELL_THEME=$(gum choose "Yes" "No")
if [ "$WANTS_SHELL_THEME" = "Yes" ]
then
ln -s "$SCRIPT_DIR/fish" $HOME/.config/
fi
gum style --border rounded --margin '1 1' --padding '1 1' --align center --foreground '#5BCEFA' --border-foreground '#F5A9B8' 'Do you want to install nikus shell theme' 'If you havnt installed nikus fish config you need to reference starship in your shell, by yourself'
WANTS_SHELL_STARSHIP=$(gum choose "Yes" "No")
if [ "$WANTS_SHELL_STARSHIP" = "Yes" ]
then
ln -s "$SCRIPT_DIR/starship/config.toml" $HOME/.config/starship.toml
fi
gum style --border rounded --margin '1 1' --padding '1 1' --align center --foreground '#5BCEFA' --border-foreground '#F5A9B8' 'Do you want to patch your vscodium config to use microsofts marketplace instead of open-vsx'
WANTS_SHELL_MS_MARKET=$(gum choose "Yes" "No")
if [ "$WANTS_SHELL_MS_MARKET" = "Yes" ]
then
bash ./patch-codium.sh
fi