.dotfiles/install.sh

190 lines
3.7 KiB
Bash

APPS=(
cmake
curl
flatpak
g++
btop
fastfetch
ninja-build
plasma-discover-backend-flatpak
ripgrep
rtorrent
scdaemon
steam
stow
tmux
tmuxp
virt-manager
xclip
)
FLATPAK_APPS=(
com.obsproject.Studio
com.protonvpn.www
com.ultimaker.cura
im.riot.Riot
org.blender.Blender
org.darktable.Darktable
org.freecad.FreeCAD
org.gimp.GIMP
org.inkscape.Inkscape
org.libreoffice.LibreOffice
io.gitlab.librewolf-community
com.nextcloud.desktopclient.nextcloud
)
DOTFILES=(
bash
konsole
menus
nvim
rtorrent
tmux
tmuxp
)
# Check if Snap is installed
if [ -x "$(command -v snap)" ]; then
echo "Remove Snap packages first before running this script!"
exit 1
fi
# Sym Link Home Folders To External Storage
while true; do
read -p "Do you want to link home folders with external storage? y/N: " storageChoice
storageChoice=$(echo "$storageChoice" | tr '[:upper:]' '[:lower:]')
sudo rm -rf ~/Public ~/Templates
if [ "$storageChoice" = "y" ]; then
read -p "Specify the path to the external storage device (full path must be used): " storagePath
sudo rm -rf ~/Documents ~/Pictures ~/Downloads ~/Videos
ln -s "$storagePath/Pictures/" ~/
ln -s "$storagePath/Repos/" ~/
ln -s "$storagePath/Documents/" ~/
ln -s "$storagePath/Downloads/" ~/
ln -s "$storagePath/Videos/" ~/
break
elif [ "$storageChoice" = "n" ]; then
echo "Skipping sym linking..."
cp -r ./Repos ~
break
else
echo "Invalid input. Please enter y or n."
fi
done
# Install Apt Apps
for i in "${APPS[@]}"
do
if [ -x "$(command -v $i)" ]; then
echo "$i already installed!"
else
sudo apt install $i -y
fi
done
# Add Flathub Repo
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
# Install Flatpak Apps
for i in "${FLATPAK_APPS[@]}"
do
if [ -x "$(command -v $i)" ]; then
echo "$i already installed!"
else
flatpak install $i -y
fi
done
# NVM Setup
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
source ~/.bashrc
. ~/.nvm/nvm.sh
nvm install --lts
# Add Yubikey Support to bashrc
if grep -q '# Yubikey SSH Support' ~/.bashrc; then
echo "Yubikey support already added."
else
echo "
# Yubikey SSH Support
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
" >> ~/.bashrc
fi
# Remove default menu config files
sudo rm -rf ~/.config/menus ~/.config/plasma-org.kde.plasma.desktop-appletsrc
# Link Config Files
for folder in ${DOTFILES[@]}
do
echo $folder
stow $folder --adopt
done
git restore .
# Font Install
sudo cp ./fonts/Fira_Code_Regular_Nerd_Font_Complete.ttf /usr/local/share/fonts
# Check if this is my profile
while true; do
read -p "Is this profile for Kendall? y/N: " profileChoice
profileChoice=$(echo "$profileChoice" | tr '[:upper:]' '[:lower:]')
if [ "$profileChoice" = "y" ]; then
# Add Profile Image
sudo rm ~/.face
cp ./profile/.face ~
# Add User To Group For Virtual Manager
sudo adduser kendall libvirt-qemu
break
elif [ "$profileChoice" = "n" ]; then
break
else
echo "Invalid input. Please enter y or n."
fi
done
# Add filesystem override to Librewolf
sudo flatpak override io.gitlab.librewolf-community --filesystem=$HOME
sudo flatpak override io.gitlab.librewolf-community --device=all
# Install latest Neovim
if ! [ -x "$(command -v nvim)" ]; then
sudo apt remove gettext-base -y
sudo apt install gettext -y
source ~/.bashrc
git clone https://github.com/neovim/neovim
cd neovim
make CMAKE_BUILD_TYPE=RelWithDebInfo && cd build && cpack -G DEB && sudo dpkg -i nvim-linux-x86_64.deb
cd ~/.dotfiles/ && sudo rm -rf neovim
fi
# Install TPM
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm