-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·152 lines (133 loc) · 5.13 KB
/
install.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
#!/bin/bash
echo "Welcome to the Nnisarg's Arch Linux + Suckless Setup Script!"
# Check for --no-confirm flag
NO_CONFIRM=false
if [[ "$1" == "--no-confirm" ]]; then
NO_CONFIRM=true
fi
# Function for interactive confirmation
confirm() {
if [[ $NO_CONFIRM == true ]]; then
return 0
fi
while true; do
read -rp "$1 [Y/n]: " yn
case $yn in
[Nn]*) return 1 ;;
*) return 0 ;;
esac
done
}
# Create standard directories
if confirm "Do you want to create standard directories?"; then
echo "Creating standard directories..."
mkdir -p ~/desk ~/dl ~/dox ~/pub ~/vids ~/work ~/music ~/tmplts ~/pix/ss ~/pix/walls
echo "Directories created."
fi
# Install yay if not installed
if ! type "yay" &>/dev/null; then
if confirm "yay is not installed. Do you want to install it?"; then
git clone --depth=1 https://aur.archlinux.org/yay.git
cd yay || exit
makepkg -si
cd ..
rm -rf yay
else
echo "yay installation skipped. This script requires yay to proceed."
exit 1
fi
fi
# Define package groups
declare -A mandatory_package_groups=(
["Base"]="base linux linux-firmware base-devel"
["Graphics"]="intel-media-driver mesa xf86-video-amdgpu xf86-video-vmware xf86-video-ati xf86-video-nouveau libva-intel-driver vulkan-intel libva-mesa-driver vulkan-radeon nvidia nvidia-utils lib32-nvidia-utils"
["Xorg"]="xorg-server xorg-xinit xdg-utils xorg-xinput xorg-xrandr"
["Editors"]="vi vim neovim"
["Utils"]="btrfs-progs htop wget curl openssh wireless_tools smartmontools wpa_supplicant iwd p7zip auto-cpufreq man man-db man-pages ripgrep flatpak linux-headers v4l2loopback-dkms xdg-desktop-portal-gtk ueberzug xdotool ncdu mpd mpv bluez bluez-libs bluez-utils xclip xcolor rsync git pulsemixer playerctl blueman maim unzip zip brightnessctl ntfs-3g udisks2 udiskie gvfs mlocate libnotify jq acpi sxiv pass feh fzf pipewire pipewire-pulse networkmanager neofetch picom xidlehook xorg-xsetroot lsof downgrade gptfdisk imagemagick unrar"
["Shell"]="dash zsh zsh-syntax-highlighting lxsession"
["Apps"]="silicon arandr dunst librewolf-bin chromium pcmanfm zathura zathura-pdf-mupdf"
)
declare -A optional_package_groups=(
["Appearance"]="gruvbox-dark-gtk gruvbox-dark-icons-gtk"
["Fonts"]="ttf-joypixels ttf-jetbrains-mono-nerd ttf-ms-fonts noto-fonts noto-fonts-cjk noto-fonts-extra noto-fonts-emoji ttf-fira-code ttf-dejavu ttf-liberation ttf-indic-otf"
["Development"]="nodejs npm pnpm go lua python python-pip maven jdk-openjdk"
["Apps"]="onlyoffice-bin yt-dlp github-cli ytfzf ani-cli gimp whatsie"
["Misc"]="cpig-git"
)
# Install packages
for group in "${!mandatory_package_groups[@]}"; do
for pkg in ${mandatory_package_groups[$group]}; do
if ! yay -Q "$pkg" &>/dev/null; then
echo "Installing $pkg..."
yay -S --noconfirm "$pkg"
else
echo "$pkg is already installed."
fi
done
done
for group in "${!optional_package_groups[@]}"; do
echo "Processing $group packages..."
for pkg in ${optional_package_groups[$group]}; do
if confirm "Do you want to install $pkg?"; then
if ! yay -Q "$pkg" &>/dev/null; then
echo "Installing $pkg..."
yay -S --noconfirm "$pkg"
else
echo "$pkg is already installed."
fi
else
echo "Skipping $pkg."
fi
done
done
# Install pyenv
if confirm "Do you want to install pyenv?"; then
curl -fsSL https://pyenv.run | bash
git clone https://github.com/alefpereira/pyenv-pyright.git --depth=1 $(pyenv root)/plugins/pyenv-pyright
fi
# Clone and install suckless software
suckless_repos=("dwm" "dmenu" "st" "slock")
for repo in "${suckless_repos[@]}"; do
if confirm "Do you want to install Nnisarg's $repo?"; then
rm -rf ~/.config/$repo
git clone --depth=1 "https://github.com/hect1k/$repo" ~/.config/$repo
cd ~/.config/$repo || exit
sudo make clean install
cd -
else
echo "Skipping $repo installation."
fi
done
# Nnisarg's nvim config
if confirm "Do you want to install Nnisarg's nvim config?"; then
rm -rf ~/.config/nvim
git clone --depth=1 "https://github.com/hect1k/kickstart.nvim" ~/.config/nvim
fi
# System settings
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
sudo usermod -aG input "$USER"
# Enable system services
systemctl --user enable mpd
sudo systemctl enable bluetooth
sudo systemctl enable NetworkManager
# Load kernel module
sudo modprobe v4l2loopback
# Copy local files
if confirm "Do you want to copy local configuration files?"; then
sudo cp -r .config ~/
sudo cp -r .local ~/
sudo cp -r pix/ ~/
sudo cp -r xorg.conf.d /etc/X11/
sudo cp .zshrc ~/
sudo cp .xinitrc ~/
sudo cp .gtkrc-2.0 ~/
sudo cp -r .librewolf ~/
fi
# Install and configure auto-cpufreq
sudo auto-cpufreq --install
# Fix permissions and set shell
sudo chown "$USER" ~/ -R
sudo rm -rf /bin/sh
sudo ln -s /usr/bin/dash /bin/sh
chsh -s /usr/bin/zsh
echo "Setup complete! Reboot your system to apply changes."