dots/install.sh

52 lines
1.4 KiB
Bash

#!/bin/bash
apt-get update
apt-get install -y curl git tmux zsh zsh-syntax-highlighting
# Tmux config
curl --create-dirs -fLo \
~/.config/tmux/tmux.conf \
https://git.da2001.ru/da2001/dots/raw/branch/main/.config/tmux/tmux.conf
# Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -y)"
# Install zsh-syntax-highlighting
echo "source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
# Install zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
sed -i 's/^plugins=.*[^\)]/& zsh-autosuggestions/g' ~/.zshrc
# PowerLevel10K
apt-get install -y fontconfig
mkdir -p ~/.local/share/fonts
curl -OL https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.tar.xz
tar -xvf JetBrainsMono.tar.xz -C ~/.local/share/fonts
rm JetBrainsMono.tar.xz
fc-cache
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
sed -i 's/^ZSH_THEME=.*/ZSH_THEME="powerlevel10k\/powerlevel10k"/g' ~/.zshrc
# Aliases
cat << EOF >> ~/.aliases
.aliases
alias ip='ip --color=auto'
alias ssht='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
EOF
# .bashrc
cat << EOF >> ~/.bashrc
if [ -f ~/.aliases ]; then
. ~/.aliases
fi
EOF
# zshrc
cat << EOF >> ~/.zshrc
source $HOME/.aliases
EOF