-
Notifications
You must be signed in to change notification settings - Fork 0
/
hyprland.sh
executable file
·283 lines (252 loc) · 7.78 KB
/
hyprland.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
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
#!/bin/bash
# Script based on https://github.com/SolDoesTech/HyprV4 By SolDoesTech
INSTALL_STAGE=(
ark
beautyline
betterbird-bin
blueman
bluez
bluez-utils
brightnessctl
btop
chromium
cliphist
dolphin
dunst
ffmpegthumbs
file-roller
firefox-developer-edition
grim
grimblast
gst-plugin-pipewire
gtk3
gvfs
hyprpicker
imagemagick
jq
kde-cli-tools
kvantum
lxappearance
mpv
network-manager-applet
networkmanager
noto-fonts-emoji
nwg-look
pacman-contrib
pamixer
papirus-icon-theme
parallel
pavucontrol
pipewire
pipewire-alsa
pipewire-audio
pipewire-jack
pipewire-pulse
polkit-kde-agent
python-pyamdgpuinfo
python-requests
powertop
qt5-graphicaleffects
qt5-imageformats
qt5-quickcontrols
qt5-quickcontrols2
qt5-svg
qt5-wayland
qt5ct
qt6-wayland
qt6ct
rofi-wayland
sddm
slurp
swappy
swaylock-effects
swayidle
swww
thunar
thunar-archive-plugin
ttf-monaspace-variable
otf-monaspace
ttf-jetbrains-mono-nerd
ttf-meslo-nerd
waybar
wezterm
wireplumber
wl-clipboard
wlogout
wofi
wofi
xdg-desktop-portal-hyprland
xfce4-settings
xwaylandvideobridge
)
# swaylock-effects-git # if the protocol is not updated
NVIDIA_STAGE=(
linux-headers
nvidia-dkms
nvidia-settings
libva
libva-nvidia-driver-git
)
CNT="[\e[1;36mNOTE\e[0m]"
COK="[\e[1;32mOK\e[0m]"
CER="[\e[1;31mERROR\e[0m]"
CAT="[\e[1;37mATTENTION\e[0m]"
CWR="[\e[1;35mWARNING\e[0m]"
CAC="[\e[1;33mACTION\e[0m]"
INSTLOG="install.log"
show_progress() {
while ps | grep $1 &> /dev/null;
do
echo -n "."
sleep 2
done
echo -en "Done!\n"
sleep 2
}
install_software() {
if yay -Q $1 &>> /dev/null ; then
echo -e "$COK - $1 is already installed."
else
echo -en "$CNT - Now installing $1 ."
yay -S --noconfirm $1 &>> $INSTLOG &
show_progress $!
if yay -Q $1 &>> /dev/null ; then
echo -e "\e[1A\e[K$COK - $1 was installed."
else
echo -e "\e[1A\e[K$CER - $1 install had failed, please check the install.log"
exit
fi
fi
}
clear
echo -e "$CNT - You are about to execute a script that would attempt to setup Hyprland.
Please note that Hyprland is still in Beta."
sleep 1
echo -e "$CNT - Checking for Physical or VM..."
ISVM=$(hostnamectl | grep Chassis)
echo -e "Using $ISVM"
if [[ $ISVM == *"vm"* ]]; then
echo -e "$CWR - Please note that VMs are not fully supported and if you try to run this on
a Virtual Machine there is a high chance this will fail."
sleep 1
fi
echo -e "$CNT - This script will run some commands that require sudo. You will be prompted to enter your password.
If you are worried about entering your password then you may want to review the content of the script."
sleep 1
read -rep $'[\e[1;33mACTION\e[0m] - Would you like to continue with the install (y,n) ' CONTINST
if [[ $CONTINST == "y" ]]; then
echo -e "$CNT - Setup starting..."
sudo touch /tmp/hyprv.tmp
else
echo -e "$CNT - This script will now exit, no changes were made to your system."
exit
fi
if lspci -k | grep -A 2 -E "(VGA|3D)" | grep -iq nvidia; then
ISNVIDIA=true
else
ISNVIDIA=false
fi
NET_LOC="/etc/NetworkManager/conf.d/wifi-powersave.conf"
read -rep $'[\e[1;33mACTION\e[0m] - Would you like to enable or disable WiFi powersave ? (enable,disable) ' WIFI
if [[ $WIFI == "enable" ]]; then
echo -e "[connection]\n# Values are 0 (use default), 1 (ignore/don't touch), 2 (disable) or 3 (enable).\nwifi.powersave = 2" | sudo tee $NET_LOC &>> $INSTLOG
else
echo -e "[connection]\n# Values are 0 (use default), 1 (ignore/don't touch), 2 (disable) or 3 (enable).\nwifi.powersave = 3" | sudo tee $NET_LOC &>> $INSTLOG
fi
echo -en "$CNT - Restarting NetworkManager service, Please wait."
sleep 2
sudo systemctl restart NetworkManager &>> $INSTLOG
for i in {1..6}; do
echo -n "."
sleep 1
done
echo -en "Done!\n"
sleep 2
echo -e "\e[1A\e[K$COK - NetworkManager restart completed."
read -rep $'[\e[1;33mACTION\e[0m] - Do you want to check/install yay ? (y,n) ' YAY
if [[ $YAY == "y" ]]; then
if [ ! -f /sbin/yay ]; then
echo -en "$CNT - Configuring yay."
git clone https://aur.archlinux.org/yay-bin &>> $INSTLOG
cd yay
makepkg -si --noconfirm &>> ../$INSTLOG &
show_progress $!
if [ -f /sbin/yay ]; then
echo -e "\e[1A\e[K$COK - yay configured"
cd ..
echo -en "$CNT - Updating yay."
yay -Syu --noconfirm &>> $INSTLOG &
show_progress $!
echo -e "\e[1A\e[K$COK - yay updated."
else
echo -e "\e[1A\e[K$CER - yay install failed, please check the install.log"
exit
fi
fi
fi
read -rep $'[\e[1;33mACTION\e[0m] - Would you like to install the packages? (y,n) ' INST
if [[ $INST == "y" ]]; then
if [[ "$ISNVIDIA" == true ]]; then
echo -e "$CNT - Nvidia GPU support setup stage, this may take a while..."
for SOFTWR in ${NVIDIA_STAGE[@]}; do
install_software $SOFTWR
done
sudo sed -i 's/MODULES=()/MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)/' /etc/mkinitcpio.conf
sudo mkinitcpio --config /etc/mkinitcpio.conf --generate /boot/initramfs-custom.img
echo -e "options nvidia-drm modeset=1" | sudo tee -a /etc/modprobe.d/nvidia.conf &>> $INSTLOG
fi
echo -e "$CNT - Installing Hyprland, this may take a while..."
if [[ "$ISNVIDIA" == true ]]; then
if yay -Q hyprland &>> /dev/null ; then
yay -R --noconfirm hyprland &>> $INSTLOG &
fi
install_software hyprland-nvidia
else
install_software hyprland
fi
echo -e "$CNT - Installing main components, this may take a while..."
for SOFTWR in ${INSTALL_STAGE[@]}; do
install_software $SOFTWR
done
echo -e "$CNT - Starting the Bluetooth Service..."
sudo systemctl enable --now bluetooth.service &>> $INSTLOG
sleep 2
echo -e "$CNT - Enabling the SDDM Service..."
sudo systemctl enable sddm &>> $INSTLOG
sleep 2
echo -e "$CNT - Cleaning out conflicting xdg portals..."
yay -R --noconfirm xdg-desktop-portal-gnome xdg-desktop-portal-gtk &>> $INSTLOG
fi
if [[ "$ISNVIDIA" == true ]]; then
echo -e "\nsource = ~/.config/_hypr_utils/env_var_nvidia.conf" >> _hypr/hypr/hyprland.conf
fi
echo -e "$CNT - Setting up the login screen."
sudo cp -R _hypr/_sdt /usr/share/sddm/themes/sdt
sudo chown -R $USER:$USER /usr/share/sddm/themes/sdt
sudo mkdir /etc/sddm.conf.d
echo -e "[Theme]\nCurrent=sdt" | sudo tee -a /etc/sddm.conf.d/10-theme.conf &>> $INSTLOG
WLDIR=/usr/share/wayland-sessions
if [ -d "$WLDIR" ]; then
echo -e "$COK - $WLDIR found"
else
echo -e "$CWR - $WLDIR NOT found, creating..."
sudo mkdir $WLDIR
fi
sudo cp _hypr_utils/hyprland.desktop /usr/share/wayland-sessions/
# xfconf-query -c xsettings -p /Net/ThemeName -s "Adwaita-dark"
# xfconf-query -c xsettings -p /Net/IconThemeName -s "Papirus-Dark"
# gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark"
# gsettings set org.gnome.desktop.interface icon-theme "Papirus-Dark"
# cp -f ~/.config/HyprV/backgrounds/v4-background-dark.jpg /usr/share/sddm/themes/sdt/wallpaper.jpg
echo -e "$CNT - Script had completed!"
if [[ "$ISNVIDIA" == true ]]; then
echo -e "$CAT - Since we attempted to setup an Nvidia GPU the script will now end and you should reboot.
Please type 'reboot' at the prompt and hit Enter when ready."
exit 0
fi
read -rep $'[\e[1;33mACTION\e[0m] - Would you like to start Hyprland now? (y,n) ' HYP
if [[ $HYP == "y" ]]; then
exec sudo systemctl start sddm &>> $INSTLOG
else
exit 0
fi