-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·175 lines (133 loc) · 3.44 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#!/bin/bash
if [[ -z "$NOROOT" ]]; then
NOROOT=true
fi
if [[ -z "$HOST" ]]; then
HOST="$(hostname)"
fi
function _stow () {
# if a host-specific entry exists, use it isntead of the generic one
hostver="$1-$HOST"
if [[ -d "$hostver" ]]; then
echo " Stowing $hostver..."
stow -t "$HOME/" "$hostver" --ignore='^(?!\.).+$'|| \
$(echo "ERROR: stowing failed...Exiting."; exit 1)
else
if [[ -d "$1" ]]; then
echo " Stowing $1..."
stow -t "$HOME/" "$1" --ignore='^(?!\.).+$' || \
(echo "ERROR: stowing failed...Exiting."; exit 1)
else
echo " $1 not found...ignoring..."
fi
fi
if [[ $? -eq 1 ]]; then
exit 1
fi
}
# If your distro stupidly expects /etc/zsh/zshenv instead of /etc/zshenv,
# set ETC_ZSH_DIR=true
if [[ -z "$ETC_ZSH_DIR" ]];then
ETC_ZSH_DIR=false
fi
echo -e "\nInstalling Dotfiless"
echo -e "--------------------\n"
echo -e "## ZSH \n"
if [ "$NOROOT" = false ]; then
echo " Copying /etc/zprofile. This requires root privileges"
if [[ ! -e /etc/zprofile ]]; then
sudo cp ./zsh/etc.zprofile /etc/zprofile || $(echo "ERROR: Needs root"; exit 1)
else
echo " /etc/zprofile already exists."
if ! grep -q "^\s*emulate sh -c 'source \/etc\/profile'" /etc/zprofile
then
echo 'WARNING: /etc/profile does not seem to be sourced by etc/zprofile'
fi
fi
if [ "$ETC_ZSH_DIR" = true ]; then
echo " Creating /etc/zsh and symlinking /etc/zprofile"
if [[ ! -e /etc/zsh ]];then
sudo mkdir /etc/zsh || $(echo "ERROR: Failed to create /etc/zsh.";exit 1)
fi
if [[ ! -e /etc/zsh/zprofile ]]; then
sudo ln -s /etc/zprofile /etc/zsh/zprofile
else
if ! grep -q "^\s*emulate sh -c 'source \/etc\/profile'" /etc/zsh/zprofile
then
echo 'WARNING: /etc/profile does not seem to be sourced by etc/zprofile'
fi
fi
fi
echo " Root privileges will not be used for anything else."
echo ""
fi
_stow zsh
echo " creating $HOME/.cache/zsh"
mkdir -p $HOME/.cache/zsh
echo -e "\n##BASH\n"
_stow bash
echo -e "\n##PROFILE.D\n"
_stow profile.d
echo -e "\n## PROFILE"
_stow profile
echo -e "\n## NEOVIM\n"
_stow nvim
if [ "$(ls -A $XDG_CONFIG_HOME/nvim/plugged/)" ]; then
echo " Nvim plugins already installed. If you run into issues, try to update them."
else
echo " Installing nvim plugins."
nvim +silent +PlugInstall +qall
fi
echo -e "\n## WEECHAT\n"
_stow weechat
echo -e "\n## MPV\n"
_stow mpv
echo -e "\n## DUNST\n"
_stow dunst
echo -e "\n## COMPTON\n"
_stow compton
echo -e "\n## NCMPCPP\n"
_stow ncmpcpp
echo -e "\n## QN\n"
_stow qn
echo -e "\n## mbrun\n"
_stow mbrun
echo -e "\n## RANGER\n"
_stow ranger
echo -e "\n## TMUX\n"
_stow tmux
echo -e "\n## I3STATUS\n"
_stow i3status
echo -e "\n## SWAY\n"
_stow sway
echo -e "\n## I3\n"
_stow i3
echo -e "\n## BSPWM\n"
_stow bspwm
echo -e "\n## POLYBAR\n"
_stow polybar
echo -e "\n## AUTORANDR\n"
_stow autorandr
echo -e "\n## SXHKD\n"
_stow sxhkd
echo -e "\n## I3BLOCKS\n"
_stow i3blocks
echo -e "\n## MPD\n"
_stow mpd
echo -e "\n## XINITRC\n"
_stow xinitrc
echo -e "\n## XSETTINGS\n"
_stow xsettings
echo -e "\n## STARDICT\n"
_stow stardict
echo -e "\n## ROFI\n"
_stow rofi
echo -e "\n##QUTEBROWSER\n"
_stow qutebrowser
echo -e "\n##EVENTD\n"
_stow eventd
echo -e "\n##NEWSBOAT\n"
mkdir -p $XDG_DATA_HOME/newsboat
_stow newsboat
echo -e "\n##BASHMOUNT\n"
_stow bashmount