-
Notifications
You must be signed in to change notification settings - Fork 1
/
install
85 lines (70 loc) · 4.09 KB
/
install
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
#!/bin/bash
# Change to the directory where the script is located
cd "$(dirname "$0")"
# Define colors
COLOR_RESET="\e[0m"
COLOR_INFO="\e[47;30m"
COLOR_ERROR="\e[47;31m"
# Check if running as root
if [ "$(id -u)" -eq "0" ]; then
echo -e "${COLOR_ERROR}Do not run this as root${COLOR_RESET}"
exit
fi
# Check if yay is not installed
if ! command -v yay &>/dev/null; then
# Install yay
echo -e "${COLOR_INFO}Installing yay...${COLOR_RESET}"
sudo pacman --needed --noconfirm -S git base-devel
git clone https://aur.archlinux.org/yay-git.git ~/.cache/yay-git || {
echo "${COLOR_ERROR}Failed to clone yay${COLOR_RESET}"
exit 1
}
(cd ~/.cache/yay-git && makepkg -si --noconfirm) || {
echo "${COLOR_ERROR}Failed to install yay${COLOR_RESET}"
exit 1
}
fi
# Install required packages
echo -e "${COLOR_INFO}Installing required packages...${COLOR_RESET}"
yay --needed --noconfirm -S - <./packages || {
echo "${COLOR_ERROR}Failed to install required packages${COLOR_RESET}"
exit 1
}
# Enable Flathub
echo -e "${COLOR_INFO}Enabling Flathub...${COLOR_RESET}"
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo || { echo "${COLOR_ERROR}Failed to enable Flathub${COLOR_RESET}"; }
# Enable "autologin"
echo -e "${COLOR_INFO}Enabling autologin...${COLOR_RESET}"
sudo mkdir /etc/systemd/system/[email protected]/
sudo echo -e "[Service]\nExecStart=\nExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin $USER %I $TERM" | sudo tee /etc/systemd/system/[email protected]/autostart.conf || { echo "${COLOR_ERROR}Failed to enable autologin${COLOR_RESET}"; }
# Enable bluetooth
echo -e "${COLOR_INFO}Enabling bluetooth...${COLOR_RESET}"
sudo systemctl enable bluetooth || { echo "${COLOR_ERROR}Failed to enable bluetooth${COLOR_RESET}"; }
# Copy config files and bashrc
echo -e "${COLOR_INFO}Copying config files and bashrc...${COLOR_RESET}"
cp -f -r .config/* ~/.config/ || { echo "${COLOR_ERROR}Failed to copy config files${COLOR_RESET}"; }
cp -f -r .local/* ~/.local/ || { echo "${COLOR_ERROR}Failed to copy local files${COLOR_RESET}"; }
cp -f .bashrc ~/.bashrc || { echo "${COLOR_ERROR}Failed to copy bashrc${COLOR_RESET}"; }
cp -f .bash_profile ~/.bash_profile || { echo "${COLOR_ERROR}Failed to copy bash_profile${COLOR_RESET}"; }
# Making scripts executable
echo -e "${COLOR_INFO}Making scripts executable...${COLOR_RESET}"
chmod u+rwx .local/bin/* || { echo "${COLOR_ERROR}Failed to change permissions for .local/bin/*${COLOR_RESET}"; }
chmod u+rwx .config/waybar/scripts/* || { echo "${COLOR_ERROR}Failed to change permissions for .config/waybar/scripts/*${COLOR_RESET}"; }
# Creating default directories
echo -e "${COLOR_INFO}Creating default user directories...${COLOR_RESET}"
xdg-user-dirs-update --force || { echo "${COLOR_ERROR}Failed to create default user directories${COLOR_RESET}"; }
# Applying default auto color theme
echo -e "${COLOR_INFO}Applying GTK theme for auto color change...${COLOR_RESET}"
gsettings set org.gnome.desktop.interface gtk-theme "AutoColor" || { echo "${COLOR_ERROR}Failed to apply default theme${COLOR_RESET}"; }
#Giving Flatpak permissions to use theme
echo -e "${COLOR_INFO}Giving Flatpak permissions to use theme...${COLOR_RESET}"
sudo flatpak override --filesystem=xdg-config/gtk-3.0:ro || { echo "${COLOR_ERROR}Failed to give flatpak access to xdg-config/gtk-3.0:ro${COLOR_RESET}"; }
sudo flatpak override --filesystem=xdg-config/gtk-4.0:ro || { echo "${COLOR_ERROR}Failed to give flatpak access to xdg-config/gtk-4.0:ro${COLOR_RESET}"; }
sudo flatpak override --filesystem=xdg-data/themes:ro || { echo "${COLOR_ERROR}Failed to give flatpak access to xdg-data/themes:ro${COLOR_RESET}"; }
# Removing window buttons (minimize, maximize, close)
echo -e "${COLOR_INFO}Removing window buttons (minimize, maximize, close)...${COLOR_RESET}"
gsettings set org.gnome.desktop.wm.preferences button-layout : || { echo "${COLOR_ERROR}Failed to remove window buttons${COLOR_RESET}"; }
# Final message
echo -e "${COLOR_INFO}You can now restart your computer or manually start Hyprland via \"Hyprland\"${COLOR_RESET}"
echo -e "${COLOR_INFO}Enjoy your new system $USER!${COLOR_RESET}"
cd ~