-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_void_linux.sh
More file actions
366 lines (274 loc) · 8.24 KB
/
setup_void_linux.sh
File metadata and controls
366 lines (274 loc) · 8.24 KB
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
#!/bin/sh
# NOTE: Give this repo a GitHub star ! Thanks ..
# AUTHOR: Eric Nantel
# LINK: https://github.com/ericnantel/dotfiles/setup_void_linux.sh
# TODO: Setup nerd fonts and verify for clang tools for vim and neovim
os=$(uname -o)
timestamp=$(date "+%Y.%m.%d-%H.%M.%S")
dotfiles=$(dirname "$0")
# update package manager
sudo xbps-install -Syu xbps
# update installed packages
sudo xbps-install -Syu
# remove unused packages
sudo xbps-remove -yo
# removed outdated kernel versions
sudo vkpurge rm all
# install recommended packages
sudo xbps-install -Sy git \
vim \
neovim \
tmux \
yq \
eza \
delta \
starship \
ripgrep \
fd \
fzf \
rsync \
most \
zsh \
zsh-syntax-highlighting
# install optional packages
sudo xbps-install -Sy htop \
fastfetch \
wezterm \
ghostty \
emacs \
wezterm \
ghostty
# install extra packages
# TODO: obs, vlc (also make sure to install libdvd-pkg)
# TODO: Clang, Clangd, Clang-Format (Should we simply install LLVM and set path in Vim for Clang-Format ?)
# NOTE: webpack, kubecolor are missing ? Also I removed kubectl from recommended packages.
# backup existing cf.map.gz
if [ -f /usr/share/kbd/keymaps/i386/qwerty/cf.map.gz ]; then
sudo mv /usr/share/kbd/keymaps/i386/qwerty/cf.map.gz /usr/share/kbd/keymaps/i386/qwerty/cf-${timestamp}.map.gz
fi
# copy cf.map
sudo cp ${dotfiles}/void-linux/usr/share/kbd/keymaps/i386/qwerty/cf.map /usr/share/kbd/keymaps/i386/qwerty/cf.map
# compress cf.map to cf.map.gz
sudo gzip /usr/share/kbd/keymaps/i386/qwerty/cf.map
# backup existing rc.conf
if [ -f /etc/rc.conf ]; then
sudo mv /etc/rc.conf /etc/rc-${timestamp}.conf
fi
# copy rc.conf
sudo cp ${dotfiles}/void-linux/etc/rc.conf /etc/rc.conf
# backup existing libc-locales
if [ -f /etc/default/libc-locales ]; then
sudo mv /etc/default/libc-locales /etc/default/libc-locales-${timestamp}
fi
# copy libc-locales
sudo cp ${dotfiles}/void-linux/etc/default/libc-locales /etc/default/libc-locales
# backup existing locale.conf
if [ -f /etc/locale.conf ]; then
sudo mv /etc/locale.conf /etc/locale-${timestamp}.conf
fi
# copy locale.conf
sudo cp ${dotfiles}/void-linux/etc/locale.conf /etc/locale.conf
# reconfigure locales
sudo xbps-reconfigure -f glibc-locales
# localedef --list-archive
# locale -a
# make directory ~/.local/share/fonts
mkdir -p ~/.local/share/fonts
# make directory ~/.local/share/fonts/nerd-fonts
mkdir -p ~/.local/share/fonts/nerd-fonts
# copy nerd fonts
cp -rp ${dotfiles}/fonts/nerd-fonts/* ~/.local/share/fonts/nerd-fonts
# reconfigure fonts
sudo xbps-reconfigure -f fontconfig
# clean and regenerate font cache
fc-cache -f -v ~/.local/share/fonts
# fc-list | grep "JetBrainsMono"
# make directory /etc/xbps.d
sudo mkdir -p /etc/xbps.d
# copy hyprland xbps repository
sudo cp ${dotfiles}/void-linux/etc/xbps.d/hyprland-void.conf /etc/xbps.d/hyprland-void.conf
# refresh xbps repositories
sudo xbps-install -S
# install hyprland and related packages
sudo xbps-install -Syu hyprland \
hyprland-devel \
xdg-desktop-portal-hyprland \
xorg-server-xwayland \
gtk-layer-shell \
wayland \
wayland-protocols \
dbus \
seatd \
polkit \
elogind \
ffmpeg \
pipewire \
wireplumber \
linux-firmware-intel \
intel-video-accel \
mesa-dri \
kitty \
hyprpaper \
Waybar \
wlogout \
wofi \
socat \
firefox
xbps-query -Rs hypr
# enable dbus service
sudo ln -s /etc/sv/dbus /var/service/dbus
# disable acpid service
# sudo rm /var/service/acpid
# enable polkitd service
sudo ln -s /etc/sv/polkitd /var/service/polkitd
# enable seatd service
sudo ln -s /etc/sv/seatd /var/service/seatd
# add user to _seatd group
sudo usermod -aG _seatd $USER
# enable elogind service
sudo ln -s /etc/sv/elogind /var/service/elogind
# add user to _pipewire group
sudo usermod -aG _pipewire $USER
# make directory ~/.config/hypr
mkdir -p ~/.config/hypr
# copy hyprland config (including hyprpaper and custom script)
cp -rp ${dotfiles}/.config/hypr/* ~/.config/hypr
# make directory ~/.config/waybar
mkdir -p ~/.config/waybar
# copy waybar config
cp -rp ${dotfiles}/.config/waybar/* ~/.config/waybar
# make directory ~/.config/wofi
mkdir -p ~/.config/wofi
# copy wofi config
cp -rp ${dotfiles}/.config/wofi/* ~/.config/wofi
# log installed git version
git --version
# init and update submodules
cd ${dotfiles}
git submodule init
git submodule update
cd -
# backup existing git config
if [ -f ~/.gitconfig ]; then
mv ~/.gitconfig ~/.gitconfig-${timestamp}
fi
# copy git config
cp ${dotfiles}/.gitconfig-delta ~/.gitconfig
# source git config
#source ~/.gitconfig
# backup existing .bashrc
if [ -f ~/.bashrc ]; then
mv ~/.bashrc ~/.bashrc-${timestamp}
fi
# copy .bashrc
cp ${dotfiles}/.bashrc ~/.bashrc
# source bash config
#source ~/.bashrc
# backup existing .zshrc
if [ -f ~/.zshrc ]; then
mv ~/.zshrc ~/.zshrc-${timestamp}
fi
# copy .zshrc
cp ${dotfiles}/.zshrc ~/.zshrc
# source zsh config
#source ~/.zshrc
# set zsh as current shell for current user
# NOTE: Add sudo to set it for root user
chsh -s $(which zsh)
# copy wezterm config
cp ${dotfiles}/.wezterm.lua ~/.wezterm.lua
# source wezterm config
#source ~/.wezterm.lua
# make directory ~/.config/ghostty
mkdir -p ~/.config/ghostty
# copy ghostty config
cp ${dotfiles}/.config/ghostty/config ~/.config/ghostty/config
# source ghostty config
#source ~/.config/ghostty/config
# make directory ~/.config/ghostty/themes
mkdir -p ~/.config/ghostty/themes
# copy ghostty themes
cp ${dotfiles}/ghostty-themes/ghostty-night-owl/NightOwlDark ~/.config/ghostty/themes/NightOwlDark
# copy starship config
cp ${dotfiles}/.config/starship.toml ~/.config/starship.toml
# make directory ~/.kube
mkdir -p ~/.kube
# copy kubecolor config
cp ${dotfiles}/.kube/color.yaml ~/.kube/color.yaml
# copy tmux config
cp ${dotfiles}/.tmux.conf ~/.tmux.conf
# make directory ~/.tmux/plugins/tpm
mkdir -p ~/.tmux/plugins/tpm
# copy tmux plugin manager (tpm)
cp -rp ${dotfiles}/.tmux/plugins/tpm/* ~/.tmux/plugins/tpm
sudo xbps-install -Sy python3 \
python3-virtualenv \
lua \
nodejs \
yarn \
cmake \
clang \
clang-tools-extra \
Bear \
bat \
curl \
unzip \
fzf \
ripgrep \
doxygen \
gtest-devel
# backup existing Jetbrains IntelliJ vim config
if [ -f ~/.ideavimrc ]; then
mv ~/.ideavimrc ~/.ideavimrc-${timestamp}
fi
# copy Jetbrains IntelliJ vim config
cp ${dotfiles}/.ideavimrc ~/.ideavimrc
# backup existing vim config
if [ -f ~/.vimrc ]; then
mv ~/.vimrc ~/.vimrc-${timestamp}
fi
# copy vim config
cp ${dotfiles}/.vimrc ~/.vimrc
# source vim config
source ~/.vimrc
# make directories ~/.vim, ~/.vim/autoload, ~/.vim/bundle, ~/.vim/colors, ~/.vim/plugged, ~/.vim/undodir
mkdir -p ~/.vim
mkdir -p ~/.vim/autoload
mkdir -p ~/.vim/bundle
mkdir -p ~/.vim/colors
mkdir -p ~/.vim/plugged
mkdir -p ~/.vim/undodir
# copy vim coc settings to ~/.vim
cp ${dotfiles}/.vim/coc-settings.json ~/.vim/coc-settings.json
# copy vim plug to ~/.vim/autoload
cp ${dotfiles}/vim-plug/plug.vim ~/.vim/autoload/plug.vim
# copy vim colorschemes to ~/.vim/colors
cp ${dotfiles}/colorschemes/candle-grey/colors/candle-grey.vim ~/.vim/colors/candle-grey.vim
cp ${dotfiles}/colorschemes/darcula/colors/darcula.vim ~/.vim/colors/darcula.vim
cp ${dotfiles}/colorschemes/vim-gruvbox8/colors/gruvbox8.vim ~/.vim/colors/gruvbox8.vim
# make directories for ~/.vim, ~/.vim/undodir-nvim, ~/.config/nvim, ~/.config/nvim/colors
mkdir -p ~/.vim
mkdir -p ~/.vim/undodir-nvim
mkdir -p ~/.config/nvim
mkdir -p ~/.config/nvim/colors
# copy neovim config
cp -rp ${dotfiles}/.config/nvim/* ~/.config/nvim
# copy vim colorschemes to ~/.config/nvim/colors
cp ${dotfiles}/colorschemes/candle-grey/colors/candle-grey.vim ~/.config/nvim/colors/candle-grey.vim
cp ${dotfiles}/colorschemes/darcula/colors/darcula.vim ~/.config/nvim/colors/darcula.vim
cp ${dotfiles}/colorschemes/vim-gruvbox8/colors/gruvbox8.vim ~/.config/nvim/colors/gruvbox8.vim
# NOTE: Won't add emacs as a service, because Hyprland will take care of it
# backup existing emacs config
if [ -d ~/.emacs.d ]; then
mkdir -p ~/.emacs.d-${timestamp}
mv ~/.emacs.d/* ~/.emacs.d-${timestamp}
fi
# make directory ~/.emacs.d
mkdir -p ~/.emacs.d
# copy emacs config
cp ${dotfiles}/.emacs.d/init.el ~/.emacs.d/init.el
# copy emacs themes/colorschemes
cp ${dotfiles}/.emacs.d/cappuccino-noir-theme.el ~/.emacs.d/cappuccino-noir-theme.el
cp ${dotfiles}/.emacs.d/somnus-theme.el ~/.emacs.d/somnus-theme.el
# reboot now
sudo shutdown -r now