diff --git a/install.sh b/install.sh deleted file mode 100755 index 15098c1..0000000 --- a/install.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh - -# The progam assumes the user put this directory in their home folder - -# Check for config folder -[ -d "~/.config" ] && mkdir ~/.config -[ -d "~/Pictures" ] && mkdir ~/Pictures - -# Add symlinks for each folder -# The file checks are to prevent a weird error in the way the symlink command works -ln -s ~/.dotfiles/.config/nvim ~/.config/nvim -ln -s ~/.dotfiles/.config/bottom ~/.config/bottom -ln -s ~/.dotfiles/.config/cava ~/.config/cava -ln -s ~/.dotfiles/Wallpapers ~/Pictures/Wallpapers -ln -s ~/.dotfiles/.config/ranger ~/.config/ranger -ln -s ~/.dotfiles/.config/i3 ~/.config/i3 -ln -s ~/.dotfiles/.config/picom ~/.config/picom -ln -s ~/.dotfiles/.config/polybar ~/.config/polybar -ln -s ~/.dotfiles/.config/dunst ~/.config/dunst -ln -s ~/.dotfiles/.config/rofi ~/.config/rofi -ln -s ~/.dotfiles/.config/bashtop ~/.config/bashtop -ln -s ~/.dotfiles/.nap ~/.nap -ln -s ~/.dotfiles/.config/neofetch ~/.config/neofetch -ln -s ~/.dotfiles/.config/eww ~/.config/eww - -ln -s ~/.dotfiles/.zshrc ~/.zshrc -ln -s ~/.dotfiles/.zshenv ~/.zshenv -ln -s ~/.dotfiles/.vimrc ~/.vimrc -ln -s ~/.dotfiles/.gitconfig ~/.gitconfig -ln -s ~/.dotfiles/.alacritty.yml ~/.alacritty.yml -ln -s ~/.dotfiles/.p10k.zsh ~/.p10k.zsh -ln -s ~/.dotfiles/.paths ~/.paths -ln -s ~/.dotfiles/.profile ~/.profile - -# Remove double symlinks -rm ~/.config/nvim/nvim -rm ~/.nap/.nap -rm ~/.config/cava/cava -rm ~/.config/bottom/bottom -rm ~/Pictures/Wallpapers/Wallpapers -rm ~/.config/ranger/ranger -rm ~/.config/i3/i3 -rm ~/.config/picom/picom -rm ~/.config/polybar/polybar -rm ~/.config/dunst/dunst -rm ~/.config/rofi/rofi -rm ~/.config/bashtop/bashtop -rm ~/.config/neofetch/neofetch -rm ~/.config/eww/eww diff --git a/symlinks.sh b/symlinks.sh new file mode 100755 index 0000000..f107601 --- /dev/null +++ b/symlinks.sh @@ -0,0 +1,74 @@ +#!/usr/bin/sh +# +# +# +DOTFILES_DIR="$HOME/.dotfiles" + +if [[ $(pwd) != $DOTFILES_DIR ]]; then + echo "This file should only be run from the dotfiles directory."; + echo "If you have not already, rename this repo to $DOTFILES_DIR, and run ./install.sh from there"; + exit 0; +fi + +# Check for config folder +[ -d "~/.config" ] && mkdir ~/.config +[ -d "~/Pictures" ] && mkdir ~/Pictures + +# Add symlinks for each folder +link() { + ln -s $DOTFILES_DIR/nvim ~/.config/nvim + ln -s $DOTFILES_DIR/.config/bottom ~/.config/bottom + ln -s $DOTFILES_DIR/.config/cava ~/.config/cava + ln -s $DOTFILES_DIR/Wallpapers ~/Pictures/Wallpapers + ln -s $DOTFILES_DIR/.config/ranger ~/.config/ranger + ln -s $DOTFILES_DIR/.config/i3 ~/.config/i3 + ln -s $DOTFILES_DIR/.config/picom ~/.config/picom + ln -s $DOTFILES_DIR/.config/polybar ~/.config/polybar + ln -s $DOTFILES_DIR/.config/dunst ~/.config/dunst + ln -s $DOTFILES_DIR/.config/rofi ~/.config/rofi + ln -s $DOTFILES_DIR/.config/bashtop ~/.config/bashtop + ln -s $DOTFILES_DIR/.nap ~/.nap + ln -s $DOTFILES_DIR/.config/neofetch ~/.config/neofetch + ln -s $DOTFILES_DIR/.config/eww ~/.config/eww + + ln -s ~/.dotfiles/.zshrc ~/.zshrc + ln -s ~/.dotfiles/.zshenv ~/.zshenv + ln -s ~/.dotfiles/.vimrc ~/.vimrc + ln -s ~/.dotfiles/.gitconfig ~/.gitconfig + ln -s ~/.dotfiles/.alacritty.yml ~/.alacritty.yml + ln -s ~/.dotfiles/.p10k.zsh ~/.p10k.zsh + ln -s ~/.dotfiles/.paths ~/.paths + ln -s ~/.dotfiles/.profile ~/.profile +} + + +unlink() { + rm -rf ~/.config/nvim + rm -rf ~/.config/bottom + rm -rf ~/.config/cava + rm -rf ~/Pictures/Wallpapers + rm -rf ~/.config/ranger + rm -rf ~/.config/i3 + rm -rf ~/.config/picom + rm -rf ~/.config/polybar + rm -rf ~/.config/dunst + rm -rf ~/.config/rofi + rm -rf ~/.config/bashtop + rm -rf ~/.nap + rm -rf ~/.config/neofetch + rm -rf ~/.config/eww + + rm -f ~/.zshrc + rm -f ~/.zshenv + rm -f ~/.vimrc + rm -f ~/.gitconfig + rm -f ~/.alacritty.yml + rm -f ~/.p10k.zsh + rm -f ~/.paths + rm -f ~/.profile +} + +unlink +if ! [[ $1 == 'remove' ]]; then + link +fi