2023-10-21 23:30:19 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Exit if ran using sh
|
|
|
|
if [ ! "$BASH_VERSION" ] ; then
|
|
|
|
printf "\033[0;31mPlease run the script using 'bash' instead of 'sh'\033[0m\n"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P )
|
|
|
|
cd "$parent_path" || exit
|
|
|
|
|
|
|
|
# ------------------- Config functions -------------------
|
|
|
|
|
|
|
|
setup_nvim() {
|
|
|
|
echo -e "\033[0;33mSetting up neovim...\033[0m"
|
|
|
|
|
2023-11-06 20:11:34 +00:00
|
|
|
sudo pacman -S neovim
|
2023-10-21 23:30:19 +00:00
|
|
|
|
2023-11-06 20:11:34 +00:00
|
|
|
# Install packer.nvim
|
2023-10-21 23:30:19 +00:00
|
|
|
git clone --depth 1 https://github.com/wbthomason/packer.nvim\
|
|
|
|
~/.local/share/nvim/site/pack/packer/start/packer.nvim
|
|
|
|
|
2023-11-06 20:11:34 +00:00
|
|
|
git submodule update --init .config/nvim/pack/github/start/copilot.vim
|
|
|
|
|
2023-10-21 23:30:19 +00:00
|
|
|
echo -e "\033[0;32mNeovim setup complete!\033[0m"
|
|
|
|
}
|
|
|
|
|
|
|
|
setup_zsh() {
|
|
|
|
echo -e "\033[0;33mSetting up zsh...\033[0m"
|
|
|
|
|
2023-11-06 20:11:34 +00:00
|
|
|
git submodule update --init .zsh/zsh-autosuggestions
|
|
|
|
git submodule update --init .zsh/zsh-syntax-highlighting
|
2023-10-22 14:38:18 +00:00
|
|
|
|
2023-11-06 20:11:34 +00:00
|
|
|
sudo pacman -S zsh
|
|
|
|
|
|
|
|
sudo chsh tiagorg --shell=/usr/bin/zsh
|
|
|
|
sudo chsh root --shell=/usr/bin/zsh
|
2023-10-22 14:38:18 +00:00
|
|
|
|
2023-10-21 23:30:19 +00:00
|
|
|
echo -e "\033[0;32mzsh setup complete!\033[0m"
|
|
|
|
}
|
|
|
|
|
2023-11-06 20:11:34 +00:00
|
|
|
setup_gnome_shell() {
|
|
|
|
dconf load /org/gnome/shell/ < ~/.config/dconf/gnome-shell.dconf.bak
|
2023-10-21 23:30:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# ------------------- End of config functions -------------------
|
|
|
|
|
|
|
|
# ------------------- Main -------------------
|
|
|
|
|
|
|
|
# Menu to choose the config_option
|
|
|
|
config_option=$(zenity --list \
|
|
|
|
--title="TiagoRG Dotfiles" \
|
|
|
|
--column="Selected the config option" \
|
|
|
|
"Full setup" \
|
|
|
|
"Neovim" \
|
|
|
|
"zshrc" \
|
2023-11-06 20:11:34 +00:00
|
|
|
"gnome-shell" \
|
2023-10-21 23:30:19 +00:00
|
|
|
--width=500 --height=400)
|
|
|
|
|
|
|
|
# Check if the user selected an option
|
|
|
|
if [ -z "$config_option" ]; then
|
|
|
|
echo -e "\033[0;31mNo option selected. Exiting...\033[0m"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo -e "\033[0;33mSelected option: $config_option\033[0m"
|
|
|
|
|
|
|
|
# Check which option was selected
|
|
|
|
case $config_option in
|
|
|
|
"Full setup")
|
|
|
|
setup_nvim
|
|
|
|
setup_zsh
|
2023-11-06 20:11:34 +00:00
|
|
|
setup_gnome_shell
|
2023-10-21 23:30:19 +00:00
|
|
|
;;
|
|
|
|
"Neovim")
|
|
|
|
setup_nvim
|
|
|
|
;;
|
|
|
|
"zshrc")
|
|
|
|
setup_zsh
|
|
|
|
;;
|
2023-11-06 20:11:34 +00:00
|
|
|
"gnome-shell")
|
|
|
|
setup_gnome_shell
|
2023-10-21 23:30:19 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo -e "\033[0;31mInvalid option. Exiting...\033[0m"
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo -e "\033[0;32mSetup complete!\033[0m"
|
|
|
|
# ------------------- End of Main -------------------
|