-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.sh
More file actions
executable file
·248 lines (209 loc) · 5.23 KB
/
configure.sh
File metadata and controls
executable file
·248 lines (209 loc) · 5.23 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
#!/bin/bash
dirname=$(dirname "$0")
# --- Packages
while getopts ":carlh" o; do
case "${o}" in
a)
addons_open=1
;;
c)
configure_only=1
;;
r)
reload_all=1
;;
l)
laptop=1
;;
h)
echo "./configure.sh [options]"
echo "-c Load only configs (no package downloads)"
echo "-a Load addons (requires open sway)"
echo "-r Reload all configs (requires open sway)"
echo "-l Laptop configuration"
echo "-h Displays this message"
exit 0
;;
esac
done
shift $((OPTIND-1))
# Official packages
official=(
# Manuals
man-db
# Fonts
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
otf-font-awesome
# Sway
sway
swaybg
waybar
xorg-xwayland
wl-clipboard
libnotify
mako
# Sound
alsa-utils
pavucontrol
pipewire
wireplumber
helvum
pipewire-alsa
pipewire-pulse
pipewire-jack
# Screen recording
grim
slurp
xdg-desktop-portal
xdg-desktop-portal-wlr
# Tools
tmux
stress
ffmpeg
git
p7zip
lm_sensors
openssh
xdg-utils
ntfs-3g
foot
# Apps
gimp
mpv
# Theme
breeze-gtk
breeze-icons
# IME
fcitx5-im
fcitx5-mozc
fcitx5-nord
# Display
mesa
)
# Intel GPU
intel_gpu=$(lspci -nn | grep VGA | grep -i intel)
if [[ $intel_gpu ]] ; then
official+=(
vulkan-intel
intel-media-driver
intel-gpu-tools
libva-utils
)
else
echo "Intel GPU not detected. Please install appropriate drivers manually."
fi
# Laptop
if [[ $laptop == 1 ]] ; then
official+=(
thermald
)
fi
# AUR packages
aur=(
# Apps
visual-studio-code-bin
spotify
librewolf-bin
vesktop
mullvad-vpn-bin
# Sway stuff
sway-launcher-desktop
)
if [[ ! $configure_only ]] ; then
# Refresh pacman
sudo pacman -Syy
# yay from AUR
if ! yay -V > /dev/null ; then
sudo pacman --noconfirm -S --needed git
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg --noconfirm -si
cd ..
rm -rf yay
fi
sudo pacman --noconfirm -S --needed ${official[@]}
yay --noconfirm -S --needed ${aur[@]}
# Enable services
if [[ $laptop == 1 ]] ; then
sudo systemctl enable thermald.service
sudo systemctl start thermald.service
fi
# Start pipewire after install
systemctl --user start pipewire-pulse.service
else
echo "Only config updates"
fi
# --- Config
# Make dirs
mkdir -p ~/.config
mkdir -p ~/.config/sway
mkdir -p ~/.config/waybar
mkdir -p ~/.config/gtk-3.0
mkdir -p ~/.config/environment.d
mkdir -p ~/.config/fcitx5
mkdir -p ~/.config/fcitx5/conf
mkdir -p ~/.config/mako
mkdir -p ~/.config/Code/User/
mkdir -p ~/.config/spotify
mkdir -p ~/.config/wireplumber/main.lua.d
# Copy files
cp ${dirname}/config/sway/* ~/.config/sway/
cp ${dirname}/config/waybar/* ~/.config/waybar/
cp ${dirname}/config/gtk/gtk2 ~/.gtkrc-2.0
cp ${dirname}/config/gtk/gtk3 ~/.config/gtk-3.0/settings.ini
cp ${dirname}/config/bash/bashrc ~/.bashrc
cp ${dirname}/config/environment/systemd ~/.config/environment.d/env.conf
cp ${dirname}/config/fcitx5/profile ~/.config/fcitx5/
cp ${dirname}/config/fcitx5/classicui.conf ~/.config/fcitx5/conf/
cp ${dirname}/config/mako/config ~/.config/mako/
cp ${dirname}/config/vscode/settings.json ~/.config/Code/User/
cp ${dirname}/config/spotify/prefs ~/.config/spotify/
cp ${dirname}/config/pipewire/wireplumber/* ~/.config/wireplumber/wireplumber.conf.d/
# Sudo
sudo mkdir -p /etc/NetworkManager/conf.d/
sudo cp ${dirname}/config/networkmanager/dns-servers.conf /etc/NetworkManager/conf.d/
sudo cp ${dirname}/config/environment/env /etc/environment
# Images
mkdir -p ~/Images
cp ${dirname}/images/* ~/Images/
if [[ $addons_open ]] && [[ $WAYLAND_DISPLAY ]] ; then
addon () {
addon_id=$1
addon_link="https://addons.mozilla.org/firefox/downloads/latest/${addon_id}/addon-${addon_id}-latest.xpi"
echo $addon_link
}
addon_ublock=$(addon 607454)
addon_tamper=$(addon 683490)
librewolf $addon_ublock $addon_tamper > /dev/null 2>&1 &
fi
# Set other settings
gsettings set org.gnome.desktop.interface gtk-theme Breeze-Dark
gsettings set org.gnome.desktop.interface icon-theme breeze-dark
xdg-settings set default-web-browser librewolf.desktop
xdg-mime default librewolf.desktop x-scheme-handler/http
xdg-mime default librewolf.desktop x-scheme-handler/https
# Pacman
sudo sed -i -e 's/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf
# Git
test=$(git config --global user.email)
if [[ ! $test ]] ; then
read -p "Git email: " email
read -p "Git name: " name
git config --global user.email "$email"
git config --global user.name "$name"
fi
# --- Scripts
mkdir -p ~/scripts
cp ${dirname}/scripts/*.sh ~/scripts
# --- Reload needed applications
if [[ $WAYLAND_DISPLAY ]] ; then
# Non-essential
makoctl reload &
# Essential
if [[ $reload_all ]] ; then
swaymsg reload
systemctl --user restart pipewire-pulse.service
fi
fi