29 lines
1.2 KiB
Bash
29 lines
1.2 KiB
Bash
#!/bin/sh
|
|
|
|
# Backup any existing dotfiles
|
|
[ -f ~/.bashrc ] && mv ~/.bashrc ~/.bashrc.bak
|
|
[ -f ~/.nanorc ] && mv ~/.nanorc ~/.nanorc.bak
|
|
[ -f ~/.tmux.conf ] && mv ~/.tmux.conf ~/.tmux.conf.bak
|
|
[ -f ~/.dircolors ] && mv ~/.dircolors ~/.dircolors.bak
|
|
[ -d ~/.tmux ] && mv ~/.tmux ~/.tmux.bak
|
|
[ -f ~/.config/k9s/config.yml ] && mv ~/.config/k9s/config.yml ~/.config/k9s/config.bak
|
|
# Link dotfiles
|
|
[ -e ~/.tmux.conf ] || ln -s ~/.dotfiles/.tmux.conf ~/.tmux.conf
|
|
[ -e ~/.bashrc ] || ln -s ~/.dotfiles/.bashrc ~/.bashrc
|
|
[ -e ~/.nanorc ] || ln -s ~/.dotfiles/.nanorc ~/.nanorc
|
|
[ -e ~/.tmux ] || ln -s ~/.dotfiles/.tmux ~/.tmux
|
|
[ -e ~/.dircolors ] || ln -s ~/.dotfiles/.dircolors ~/.dircolors
|
|
|
|
# k9s only if directory exists
|
|
if [ -d ~/.config/k9s ]; then
|
|
[ -e ~/.config/k9s/config.yml ] || ln -s ~/.dotfiles/k9s_config.yml ~/.config/k9s/config.yml
|
|
fi
|
|
|
|
# Copy font if needed
|
|
[ -d ~/.local/share/fonts ] || cp -r ~/.dotfiles/fonts ~/.local/share
|
|
|
|
# Config directory
|
|
[ -d ~/.config/nvim ] && mv ~/.config/nvim ~/.config/nvim.old
|
|
ln -s ~/.dotfiles/nvim ~/.config/nvim
|
|
[ -d ~/.config/alacritty ] && mv ~/.config/alacritty ~/.config/alacritty.old
|
|
ln -s ~/.dotfiles/alacritty ~/.config/alacritty
|