This repository has been archived by the owner on Jun 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinstall-hyprland
253 lines (224 loc) · 10.2 KB
/
install-hyprland
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
#!/bin/bash
#
# NOTE: SUGGEST YOU USE UPDATED SCRIPTS (EITHER yay-hyprland or paru-hyprland) These new scripts gives more flexible in choosing which hyprland to install.
# Either hyprland-nvidia or hyprland only. Its included in this dots
#
# The following will be installed to run Hyprland on Asus G15 with RTX GPU
#
# NOTE! IF YOU ADD OR REMOVE PACKAGES, make sure proper spelling as per AUR and official Arch Repo and that are present.
# Adding packages not in AUR or official Arch Repo, script will fail.
#
#
# Below is a list of the packages that would be installed
# hyprland-nvidia-git: This is the Hyprland compositor
# foot: This is the default terminal
# waybar-hyprland: This is a fork of waybar with Hyprland workspace support
# swaybg: This is used to set a desktop background image
# swaylock-effects: This allows for the locking of the desktop its a fork that adds some editional visual effects
# wofi: This is an application launcher menu
# wlogout: This is a logout menu that allows for shutdown, reboot and sleep
# mako: This is a graphical notification daemon
# thunar with necessary plugins: This is a graphical file manager
# ttf-jetbrains-mono-nerd : some nerd fonts needed for proper icons in waybar
# otf-font-awesome-4 and otf-font-awesome # necessary for symbols / weather
# ttf-droid - suggested for international fonts to display properly
# polkit-gnome: needed to get superuser access on some graphical appliaction
# python-requests: needed for the weather module script to execute
# grim: This is a screenshot tool it grabs images from a Wayland compositor
# slurp: This helps with screenshots, it selects a region in a Wayland compositor
# viewnior: for photo viewing
# pamixer: This helps with audio settings such as volume
# brightnessctl: used to control monitor bright level
# bluez: the bluetooth service
# bluez-utils: command line utilities to interact with bluetooth devices
# blueman - Bluetooth manager
# lxappearance: used to set GTK theme
# dracula-gtk-theme: the Dracula theme, it fits the overall look and feel
# dracula-icons-git" set of icons to go with the Dracula theme
# bibata-cursor-theme-bin - cursor theme
# xdg-desktop-portal-hyprland-git: xdg-desktop-portal backend for hyprland
# mpv: for wofi-beats to work
# qt5ct: for visual settings for qt-apps
# mousepad: simple text editor
# Check if running as root. If root, script will exit
if [[ $EUID -eq 0 ]]; then
echo "This script should not be executed as root! Exiting......."
exit 1
fi
clear
# Set some colors for output messages
OK="$(tput setaf 2)[OK]$(tput sgr0)"
ERROR="$(tput setaf 1)[ERROR]$(tput sgr0)"
NOTE="$(tput setaf 3)[NOTE]$(tput sgr0)"
WARN="$(tput setaf 166)[WARN]$(tput sgr0)"
CAT="$(tput setaf 6)[ACTION]$(tput sgr0)"
ORANGE=$(tput setaf 166)
YELLOW=$(tput setaf 3)
RESET=$(tput sgr0)
# Function to display ASCII art
display_hello() {
cat << "EOF"
_ _ _ _ __ __ _ _ _
| | | | ___| | | ___ \ \ / /__ _ __| | __| | |
| |_| |/ _ \ | |/ _ \ \ \ /\ / / _ \| '__| |/ _` | |
| _ | __/ | | (_) | \ V V / (_) | | | | (_| |_|
|_| |_|\___|_|_|\___( ) \_/\_/ \___/|_| |_|\__,_(_)
|/
EOF
}
# Display ASCII art
display_hello
# Loop until valid input is provided
while true; do
printf "${WARN} - I stop supporting this install script!!!!!\n\n"
read -p "${NOTE} Please note that I have now moved to a newer install script. Would you like to exit and download the new script? (y/n): " initial_choice
# Check user input
if [[ $initial_choice == "y" || $initial_choice == "Y" ]]; then
echo "Exiting and downloading the new script..."
cd
git clone https://github.com/JaKooLit/Arch-Hyprland.git
cd Arch-Hyprland
chmod +x install.sh
./install.sh
break
elif [[ $initial_choice == "n" || $initial_choice == "N" ]]; then
echo "Continuing to install Arch Hyprland using this script..."
break
else
echo "Invalid choice. Please enter 'y' or 'n'."
fi
done
# ADDED!
YELLOW="$(tput setaf 3)[NOTE]$(tput sgr0)"
printf "$YELLOW WARNING! WARNING! WARNING! WARNING! WARNING!
PLEASE USE paru-hyprland or yay-hyprland script!
This script is OUTDATED and will be removed soon!"
sleep 10
exit 1
# Check if yay is installed
ISYAY=/sbin/yay
if [ -f "$ISYAY" ]; then
echo "yay was located, updating system packages..."
yay -Syu --noconfirm || { echo "Error: failed to update system packages using yay. Exiting script."; exit 1; }
else
echo "Error: yay was not located, please install yay first. Exiting script."
exit 1
fi
### Disable wifi powersave mode ###
read -n1 -rep "${CAT} Would you like to disable wifi powersave? (y,n)" WIFI
if [[ $WIFI == "Y" || $WIFI == "y" ]]; then
LOC="/etc/NetworkManager/conf.d/wifi-powersave.conf"
echo -e "The following has been added to $LOC.\n"
echo -e "[connection]\nwifi.powersave = 2" | sudo tee -a $LOC
echo -e "\n"
echo -e "Restarting NetworkManager service...\n"
sudo systemctl restart NetworkManager
sleep 3
fi
# Prompt user to install packages
# Function to check if a command executed successfully
function check_command_status {
if [ $? -ne 0 ]; then
echo -e "\nError executing command: $1"
exit 1
fi
}
read -n1 -rep 'Would you like to install the packages? (y/n)' INST
echo
if [[ $INST == "Y" || $INST == "y" ]]; then
# Install packages
yay -S --noconfirm hyprland-nvidia-git
check_command_status "yay -S hyprland-nvidia-git"
yay -S --noconfirm waybar-hyprland
check_command_status "yay -S waybar-hyprland"
yay -S --noconfirm xdg-desktop-portal-hyprland
check_command_status "yay -S xdg-desktop-portal-hyprland"
yay -S --noconfirm dracula-icons-git
check_command_status "yay -S dracula-icons-git"
yay -S --noconfirm foot swaybg swaylock-effects wofi wlogout mako thunar gvfs thunar-volman tumbler cava \
ffmpegthumbs otf-font-awesome ttf-jetbrains-mono-nerd otf-font-awesome-4 ttf-fantasque-sans-mono qt5ct wl-clipboard \
polkit-gnome python-requests grim slurp pamixer brightnessctl viewnior pavucontrol playerctl dracula-gtk-theme \
bluez bluez-utils blueman nwg-look-bin bibata-cursor-theme-bin mousepad mpv network-manager-applet
check_command_status "yay -S (packages)"
# Start the bluetooth service
echo -e "\nStarting the Bluetooth service..."
sudo systemctl enable --now bluetooth.service
check_command_status "sudo systemctl enable --now bluetooth.service"
sleep 2
# Clean out other portals
echo -e "\nCleaning out conflicting xdg portals..."
sudo pacman -R --noconfirm xdg-desktop-portal-gnome
sudo pacman -R --noconfirm xdg-desktop-portal-gtk
sudo pacman -R --noconfirm xdg-desktop-portal-kde
sudo pacman -R --noconfirm xdg-desktop-portal-wlr
sudo pacman -R --noconfirm xdg-desktop-portal-lxqt
echo -e "\nPackages installed successfully."
fi
### Copy Config Files ###
set -e # Exit immediately if a command exits with a non-zero status.
read -n1 -rep 'Would you like to copy config and wallpaper files? (y,n)' CFG
if [[ $CFG == "Y" || $CFG == "y" ]]; then
echo -e "Copying config files...\n"
mkdir -p ~/.config
cp -r config/hypr ~/.config/ || { echo "Error: Failed to copy hypr config files."; exit 1; }
cp -r config/foot ~/.config/ || { echo "Error: Failed to copy foot config files."; exit 1; }
cp -r config/swaylock ~/.config/ || { echo "Error: Failed to copy swaylock config files."; exit 1; }
cp -r config/wlogout ~/.config/ || { echo "Error: Failed to copy wlogout config files."; exit 1; }
cp -r config/xfce4 ~/.config/ || { echo "Error: Failed to copy xfce4 config files."; exit 1; }
cp -r config/Thunar ~/.config/ || { echo "Error: Failed to copy Thunar config files."; exit 1; }
cp -r config/btop ~/.config/ || { echo "Error: Failed to copy btop config files."; exit 1; }
cp -r config/cava ~/.config/ || { echo "Error: Failed to copy cava config files."; exit 1; }
mkdir -p ~/Pictures
cp -r wallpapers ~/Pictures/ || { echo "Error: Failed to copy wallpapers."; exit 1; }
# Set some files as executable
chmod +x ~/.config/hypr/scripts/airplane-mode.sh
chmod +x ~/.config/hypr/scripts/brightness
chmod +x ~/.config/hypr/scripts/changeLayout
chmod +x ~/.config/hypr/scripts/changeWallpaper
chmod +x ~/.config/hypr/scripts/fullmenu
chmod +x ~/.config/hypr/scripts/glassmorphismToggle
chmod +x ~/.config/hypr/scripts/gtkthemes
chmod +x ~/.config/hypr/scripts/lockscreen
chmod +x ~/.config/hypr/scripts/menu
chmod +x ~/.config/hypr/scripts/notifications
chmod +x ~/.config/hypr/scripts/portal-arch-hyprland
chmod +x ~/.config/hypr/scripts/screenshot
chmod +x ~/.config/hypr/scripts/startup
chmod +x ~/.config/hypr/scripts/statusbar
chmod +x ~/.config/hypr/scripts/switch-lid.sh
chmod +x ~/.config/hypr/scripts/touchpad.sh
chmod +x ~/.config/hypr/scripts/volume
chmod +x ~/.config/hypr/scripts/weather.sh
chmod +x ~/.config/hypr/scripts/wofi-beats
else
print_error " No Config files and wallpaper files copied"
fi
### Install software for Asus ROG laptops ###
read -n1 -rep '(OPTIONAL) Would you like to install Asus ROG software support? (y/n)' ROG
if [[ $ROG =~ ^[Yy]$ ]]; then
echo -e "\nInstalling ASUS ROG packages...\n"
yay -S --noconfirm asusctl
yay -S --noconfirm supergfxctl
yay -S --noconfirm rog-control-center
echo -e "\nActivating ROG services...\n"
sudo systemctl daemon-reload && sudo systemctl enable --now supergfxd
sleep 2
else
echo -e "\nAsus ROG software support not installed."
fi
### Script is done ###
echo -e "Installation Completed.\n"
echo -e "You can start Hyprland by typing Hyprland (note the capital H!).\n"
echo -e "NOTE! No Login Manager installed. You can start Hyprland by typing Hyprland (note the capital H!).\n"
echo -e "NOTE! It is highly recommended to reboot your computer first.\n"
read -n1 -rep 'Would you like to start Hyprland now? (y,n)' HYP
if [[ $HYP == "Y" || $HYP == "y" ]]; then
if command -v Hyprland >/dev/null; then
exec Hyprland
else
echo -e "Hyprland not found. Please make sure it is installed and try again.\n"
exit 1
fi
else
exit
fi