dotfiles/install.sh

151 lines
4.6 KiB
Bash
Raw Normal View History

2023-05-08 16:56:15 +02:00
#!/bin/bash
# Headless
NVIM=true
ZSH=true
PROFILE=true
TMUX=true
# GUI
AWESOME=false
ALACRITTY=false
MPV=false
#################################################
# Basic Preparation #
#################################################
OS=$(grep -E '^(NAME)=' /etc/os-release )
if [[ -z "${XDG_CONFIG_HOME}" ]]; then
mkdir -p $HOME/.config
XDG_CONFIG_HOME=$HOME/.config
fi
if [[ -z "${XDG_DATA_HOME}" ]]; then
mkdir -p $HOME/.local/share
XDG_DATA_HOME=$HOME/.local/share
fi
#################################################
# Neovim #
#################################################
if $NVIM; then
dependencies="neovim git npm unzip fzf cmake gcc make curl wget"
if [[ $OS == "NAME=\"Arch Linux\"" ]]; then
2023-05-08 17:06:58 +02:00
pacman -Sy --needed --noconfirm $dependencies
2023-05-08 16:56:15 +02:00
elif [[ $OS == "NAME=\"Ubuntu\"" ]]; then
apt update
apt install -y software-properties-common
add-apt-repository ppa:neovim-ppa/unstable -y
apt update
2023-05-08 17:19:04 +02:00
apt install -y $dependencies python-venv
2023-05-08 16:56:15 +02:00
fi
ln -s $PWD/nvim $XDG_CONFIG_HOME/nvim
ln -s $PWD/clang/.clang-tidy $HOME/.clang-tidy
git clone --depth 1 https://github.com/wbthomason/packer.nvim $XDG_DATA_HOME/nvim/site/pack/packer/start/packer.nvim
nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
fi
#################################################
# ZSH #
#################################################
if $ZSH; then
PROFILE=true
dependencies="fzf zsh curl"
if [[ $OS == "NAME=\"Arch Linux\"" ]]; then
2023-05-08 17:06:58 +02:00
pacman -Sy --needed --noconfirm $dependencies
2023-05-08 16:56:15 +02:00
echo "Please manually install yay and autojump-rs"
elif [[ $OS == "NAME=\"Ubuntu\"" ]]; then
apt update
apt install -y $dependencies autojump
fi
ln -s $PWD/zsh $XDG_CONFIG_HOME/zsh
ln -s $PWD/zsh/.zshrc $HOME/.zshrc
mkdir -p $HOME/.local/state/zsh/
curl -L http://smartcd.org/install | bash
fi
#################################################
# Profile #
#################################################
if $PROFILE; then
rm -rf $HOME/.profile && ln -s $PWD/profile/.profile $HOME/.profile
fi
#################################################
# Awesome #
#################################################
if $AWESOME; then
2023-05-08 17:06:58 +02:00
dependencies="awesome picom numlockx xcape rofi"
2023-05-08 16:56:15 +02:00
if [[ $OS == "NAME=\"Arch Linux\"" ]]; then
2023-05-08 17:06:58 +02:00
pacman -Sy --needed --noconfirm $dependencies network-manager-applet xorg-xmodmap adobe-source-code-pro-fonts noto-fonts ttf-nerd-fonts-symbols
2023-05-08 16:56:15 +02:00
elif [[ $OS == "NAME=\"Ubuntu\"" ]]; then
apt update
apt install -y $dependencies awesome-extra
fi
ln -s $PWD/awesome $XDG_CONFIG_HOME/awesome
ln -s $PWD/picom/picom.conf $XDG_CONFIG_HOME/picom.conf
2023-05-08 17:06:58 +02:00
ln -s $PWD/xmodmap/.Xmodmap $XDG_CONFIG_HOME/.Xmodmap
ln -s $PWD/rofi $XDG_CONFIG_HOME/rofi
2023-05-08 16:56:15 +02:00
fi
#################################################
# Alacritty #
#################################################
if $ALACRITTY; then
dependencies="alacritty"
if [[ $OS == "NAME=\"Arch Linux\"" ]]; then
2023-05-08 17:06:58 +02:00
pacman -Sy --needed --noconfirm $dependencies
2023-05-08 16:56:15 +02:00
elif [[ $OS == "NAME=\"Ubuntu\"" ]]; then
apt update
apt install -y software-properties-common
add-apt-repository ppa:aslatter/ppa -y
apt update
apt install -y $dependencies
fi
ln -s $PWD/alacritty $XDG_CONFIG_HOME/alacritty
fi
#################################################
# MPV #
#################################################
if $MPV; then
dependencies="mpv"
if [[ $OS == "NAME=\"Arch Linux\"" ]]; then
2023-05-08 17:06:58 +02:00
pacman -Sy --needed --noconfirm $dependencies
2023-05-08 16:56:15 +02:00
elif [[ $OS == "NAME=\"Ubuntu\"" ]]; then
apt update
apt install -y $dependencies
fi
ln -s $PWD/mpv $XDG_CONFIG_HOME/mpv
fi
#################################################
# Tmux #
#################################################
if $TMUX; then
dependencies="tmux git zsh xdg-utils"
if [[ $OS == "NAME=\"Arch Linux\"" ]]; then
2023-05-08 17:06:58 +02:00
pacman -Sy --needed --noconfirm $dependencies
2023-05-08 16:56:15 +02:00
elif [[ $OS == "NAME=\"Ubuntu\"" ]]; then
apt update
apt install -y $dependencies
fi
2023-05-08 19:15:57 +02:00
ln -s $PWD/tmux $XDG_CONFIG_HOME/tmux
git clone https://github.com/tmux-plugins/tpm $XDG_DATA_HOME/tmux/plugins/tpm
$XDG_DATA_HOME/tmux/plugins/tpm/bin/install_plugins
2023-05-08 16:56:15 +02:00
fi