forked from vEnhance/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL.sh
executable file
·140 lines (126 loc) · 5.78 KB
/
INSTALL.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/bin/sh
# Use at your own risk ;)
# makes many symlinks
set -e
set -o xtrace
cd "$HOME"/dotfiles/py3status/ || exit
make
cd "$HOME" || exit
# symlink in home
if ! test -d "$HOME/.asy"; then ln -s "$HOME"/dotfiles/asy "$HOME"/.asy; fi
if ! test -d "$HOME/.texmf"; then ln -s "$HOME"/dotfiles/texmf "$HOME"/.texmf; fi
if ! test -d "$HOME/.vit"; then ln -s "$HOME"/dotfiles/vit "$HOME"/.vit; fi
if ! test -f "$HOME/.agignore"; then ln -s "$HOME"/dotfiles/agignore "$HOME"/.agignore; fi
if ! test -f "$HOME/.bashrc"; then ln -s "$HOME"/dotfiles/bashrc "$HOME"/.bashrc; fi
if ! test -f "$HOME/.chktexrc"; then ln -s "$HOME"/dotfiles/chktexrc "$HOME"/.chktexrc; fi
if ! test -f "$HOME/.eslintrc.yaml"; then ln -s "$HOME"/dotfiles/eslintrc.yaml "$HOME"/.eslintrc.yaml; fi
if ! test -f "$HOME/.gitconfig"; then ln -s "$HOME"/dotfiles/gitconfig "$HOME"/.gitconfig; fi
if ! test -f "$HOME/.gvimrc"; then ln -s "$HOME"/dotfiles/gvimrc "$HOME"/.gvimrc; fi
if ! test -f "$HOME/.latexmkrc"; then ln -s "$HOME"/dotfiles/latexmkrc "$HOME"/.latexmkrc; fi
if ! test -f "$HOME/.mbsyncrc"; then ln -s "$HOME"/dotfiles/mutt/mbsyncrc "$HOME"/.mbsyncrc; fi
if ! test -f "$HOME/.pdbrc.py"; then ln -s "$HOME"/dotfiles/pdbrc.py "$HOME"/.pdbrc.py; fi
if ! test -f "$HOME/.screenrc"; then ln -s "$HOME"/dotfiles/screenrc "$HOME"/.screenrc; fi
if ! test -f "$HOME/.shellcheckrc"; then ln -s "$HOME"/dotfiles/shellcheckrc "$HOME"/.shellcheckrc; fi
if ! test -f "$HOME/.taskrc"; then ln -s "$HOME"/dotfiles/taskrc "$HOME"/.taskrc; fi
if ! test -f "$HOME/.xprofile"; then ln -s "$HOME"/dotfiles/xprofile "$HOME"/.xprofile; fi
if ! test -f "$HOME/.xinitrc"; then
echo "[ -f $HOME/.xprofile ] && . $HOME/.xprofile" >"$HOME"/.xinitrc
echo "exec i3" >"$HOME"/.xinitrc
fi
# file/dir in .config
mkdir -p .config
if ! test -d "$HOME/.config/bat"; then ln -s "$HOME"/dotfiles/bat "$HOME"/.config/bat; fi
if ! test -d "$HOME/.config/bugwarrior"; then ln -s "$HOME"/dotfiles/bugwarrior "$HOME"/.config/bugwarrior; fi
if ! test -d "$HOME/.config/dunst"; then ln -s "$HOME"/dotfiles/dunst "$HOME"/.config/dunst; fi
if ! test -d "$HOME/.config/fish"; then ln -s "$HOME"/dotfiles/fish "$HOME"/.config/fish; fi
if ! test -d "$HOME/.config/mirage_linemode"; then ln -s "$HOME"/dotfiles/mirage_linemode "$HOME"/.config/mirage_linemode; fi
if ! test -d "$HOME/.config/mutt"; then ln -s "$HOME"/dotfiles/mutt "$HOME"/.config/mutt; fi
if ! test -d "$HOME/.config/nvim"; then ln -s "$HOME"/dotfiles/nvim "$HOME"/.config/nvim; fi
if ! test -d "$HOME/.config/qutebrowser"; then ln -s "$HOME"/dotfiles/qutebrowser "$HOME"/.config/qutebrowser; fi
if ! test -d "$HOME/.config/ranger"; then ln -s "$HOME"/dotfiles/ranger "$HOME"/.config/ranger; fi
if ! test -d "$HOME/.config/rofi"; then ln -s "$HOME"/dotfiles/rofi "$HOME"/.config/rofi; fi
if ! test -d "$HOME/.config/zathura"; then ln -s "$HOME"/dotfiles/zathura "$HOME"/.config/zathura; fi
if ! test -d "$HOME/.config/i3"; then ln -s "$HOME"/dotfiles/i3 "$HOME"/.config/i3; fi
# nested config
if ! test -f "$HOME/.config/picom.conf"; then
ln -s "$HOME"/dotfiles/picom.conf "$HOME"/.config/picom.conf
fi
if ! test -f "$HOME/.config/proselint/config.json"; then
mkdir -p "$HOME"/.config/proselint
ln -s "$HOME"/dotfiles/proselintrc "$HOME"/.config/proselint/config.json
fi
if ! test -d "$HOME/.config/py3status"; then
mkdir -p "$HOME"/.config/py3status
ln -s "$HOME/dotfiles/py3status/py3status.$(hostname)".conf "$HOME"/.config/py3status/config
fi
if ! test -f "$HOME/.config/gtk-3.0/settings.ini"; then
mkdir -p "$HOME"/.config/gtk-3.0
ln -s "$HOME"/dotfiles/gtk3-settings.ini "$HOME"/.config/gtk-3.0/settings.ini
fi
if ! test -d "$HOME/.config/xfce4/terminal"; then
mkdir -p "$HOME"/.config/xfce4/
ln -s "$HOME"/dotfiles/terminal "$HOME"/.config/xfce4/terminal
fi
if ! test -f "$HOME/.config/gh/config.yml"; then
mkdir -p "$HOME"/.config/gh
ln -s "$HOME"/dotfiles/gh-config.yml "$HOME"/.config/gh/config.yml
fi
if ! test -f "$HOME/.config/redshift/redshift.conf"; then
mkdir -p "$HOME"/.config/redshift/
ln -s "$HOME"/dotfiles/redshift.conf "$HOME"/.config/redshift/redshift.conf
fi
# .local
if ! test -d "$HOME/.local/share/gh/extensions"; then
mkdir -p "$HOME"/.local/share/gh
ln -s "$HOME"/dotfiles/gh-extensions "$HOME"/.local/share/gh/extensions
fi
# taskwarrior hooks
mkdir -p .task/hooks
if [ -z "$(ls -A "$HOME/.task/hooks")" ]; then
rmdir "$HOME/.task/hooks"
fi
if ! test -d "$HOME/.task/hooks"; then
ln -s "$HOME"/dotfiles/tw-hooks "$HOME"/.task/hooks
fi
# vim
mkdir -p "$HOME"/.vim/tmp/
mkdir -p "$HOME"/.vim/after/
mkdir -p "$HOME"/.vim/tags/
if ! test -d "$HOME/.vim/after/ftplugin"; then
ln -s "$HOME"/dotfiles/vim/after/ftplugin "$HOME"/.vim/after/ftplugin
fi
if ! test -d "$HOME/.vim/after/syntax"; then
ln -s "$HOME"/dotfiles/vim/after/syntax "$HOME"/.vim/after/syntax
fi
if ! test -d "$HOME/.vim/colors"; then
ln -s "$HOME"/dotfiles/vim/colors "$HOME"/.vim/colors
fi
if ! test -d "$HOME/.vim/doc"; then
ln -s "$HOME"/dotfiles/vim/doc "$HOME"/.vim/doc
fi
# stopgap
if ! test -d "$HOME/.vim/spell"; then
if test -d "$HOME"/dotfiles/vim/spell; then
ln -s "$HOME"/dotfiles/vim/spell "$HOME"/.vim/spell
fi
fi
if ! test -f "$HOME/.vim/coc-settings.json"; then
ln -s "$HOME"/dotfiles/vim/coc-settings.json "$HOME"/.vim/coc-settings.json
fi
if ! test -f "$HOME/.vim/vimrc"; then
ln -s "$HOME"/dotfiles/vim/vimrc "$HOME"/.vim/vimrc
fi
if ! test -f "$HOME/.vimrc"; then
ln -s "$HOME"/dotfiles/vim/vimrc "$HOME"/.vimrc
fi
# systemd
mkdir -p "$HOME"/.config/systemd/user
for i in "$HOME"/dotfiles/custom-systemd-units/*; do
if ! test -f "$HOME/.config/systemd/user/$(basename "$i")"; then
ln -s "$i" "$HOME"/.config/systemd/user/
fi
done
if [ "$USER" = "evan" ]; then
xdg-settings set default-web-browser org.qutebrowser.qutebrowser.desktop
xdg-settings set default-url-scheme-handler https org.qutebrowser.qutebrowser.desktop
fi