-
Notifications
You must be signed in to change notification settings - Fork 0
/
symlinks.sh
executable file
·74 lines (69 loc) · 2.83 KB
/
symlinks.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/zsh
if [[ -z $HOME ]]; then
echo "Environment variable HOME not set."
exit 2
fi
if [[ $# == 1 ]]; then
SYSTEM_NAME=$1
else
SYSTEM_NAME=$(hostname)
fi
echo "Setting symlinks for $SYSTEM_NAME"
CONFIG=$HOME/projects/config
function make_symlink {
target="$CONFIG/$1"
name="$HOME/$2"
mkdir -p $(dirname "$name")
if [[ -L "$name" ]]; then
if [[ $(readlink -f "$name") != $target ]]; then
echo "Deleting previously existing symlink: $target"
rm $name
ln -s "$target" "$name"
fi
elif [[ ! -a "$name" ]]; then
echo "$target\t\t -> $name"
ln -s "$target" "$name"
else
echo "File already exists: $name"
fi
}
# The good, following the XDG_CONFIG_DIR structure
make_symlink beets/config.yaml .config/beets/config.yaml
make_symlink bat/config .config/bat/config
make_symlink dunst/dunstrc .config/dunst/dunstrc
make_symlink i3/i3.conf .config/i3/config
make_symlink i3/${SYSTEM_NAME}.conf .config/i3/system.conf
make_symlink i3/i3wsr/config.toml .config/i3wsr/config.toml
make_symlink i3/i3status_${SYSTEM_NAME}.conf .config/i3status/config
make_symlink hyprland/hyprland.conf .config/hypr/hyprland.conf
make_symlink hyprland/waybar.jsonc .config/waybar/config.jsonc
make_symlink hyprland/waybar-style.css .config/waybar/style.css
make_symlink hyprland/hyprland-autoname-workspaces-config.toml .config/hyprland-autoname-workspaces/config.toml
make_symlink kitty/kitty.conf .config/kitty/kitty.conf
make_symlink mpd/${SYSTEM_NAME}.conf .config/mpd/mpd.conf
make_symlink rofi/config.rasi .config/rofi/config.rasi
make_symlink vim/init.vim .config/nvim/init.vim
make_symlink zathura/zathurarc .config/zathura/zathurarc
make_symlink taskwarrior/taskrc .config/task/taskrc
make_symlink taskwarrior/hooks .local/share/task/hooks
make_symlink zsh/zshrc.sh .config/zsh/.zshrc # ZDOTDIR
make_symlink zsh/zshenv .zshenv
make_symlink bash/inputrc.sh .config/readline/inputrc # INPUTRC
make_symlink newsboat/config .config/newsboat/config
make_symlink newsboat/urls .config/newsboat/urls
make_symlink git/gitconfig.conf .config/git/config
make_symlink vim/init.vim .config/vim/vimrc
make_symlink cargo/${SYSTEM_NAME}.toml .cargo/config.toml # ...
make_symlink flameshot/flameshot.ini .config/flameshot/flameshot.ini
make_symlink helix/config.toml .config/helix/config.toml
make_symlink nushell/config.nu .config/nushell/config.nu
make_symlink nushell/env.nu .config/nushell/env.nu
make_symlink vdirsyncer/config .config/vdirsyncer/config
make_symlink khal/config .config/khal/config
make_symlink striputary/config.yml .config/striputary/config.yaml
# The weird
make_symlink taskwarrior/${SYSTEM_NAME}.conf .config/task/system.conf
# The EVIL, polluting my home directory
make_symlink bash/bashrc.sh .bashrc
make_symlink emacs/init.el .emacs.d/init.el
make_symlink ssh/config .ssh/config