install.sh: split packages into seperate files

This commit is contained in:
krolxon 2025-12-10 13:42:50 +05:30
parent 371950d900
commit 80cda2bb65
8 changed files with 160 additions and 137 deletions

View File

@ -2,4 +2,5 @@
README.md
assets
system
packages
install.sh

View File

@ -1,152 +1,39 @@
#!/bin/env bash
pkg_utils=(
"fd"
"ffmpegthumbnailer"
"foot"
"fuzzel"
"fzf"
"gammastep"
"ghostscript"
"gobject-introspection"
"gparted"
"grub"
"gvfs"
"gvfs-mtp"
"imagemagick"
"imlib2"
"jq"
"kanshi"
"lf"
"libnotify"
"libreoffice-fresh"
"lua"
"lvm2"
"man-db"
"meson"
"mpc"
"mpd"
"mpd-mpris"
"mpv"
"ncdu"
"ncmpcpp"
"ntfs-3g"
"nwg-look"
"pacman-contrib"
"pamixer"
"pavucontrol"
"pcmanfm"
"pipewire"
"pipewire-pulse"
"progress"
"python-gobject"
"python-pip"
"python-virtualenv"
"qpdf"
"reflector"
"ripgrep"
"rsync"
"sshfs"
"stow"
"tesseract"
"torbrowser-launcher"
"transmission-cli"
"noto-fonts"
"noto-fonts-cjk"
"noto-fonts-emoji"
"ttf-jetbrains-mono-nerd"
"tree"
"unzip"
"waybar"
"wget"
"woff2-font-awesome"
"wtype"
"xarchiver"
"xdg-user-dirs"
"yt-dlp"
"zathura"
"zathura-pdf-mupdf"
"zip"
"zola"
"zsh"
"zsh-autosuggestions"
)
currentDir="$(dirname "$(readlink -f "$0")")"
cd "$currentDir"
pkg_dev_tools=(
"git"
"neovim"
"platformio-core"
"tmux"
"nodejs"
"lazygit"
)
pkg_optional=(
"keepassxc"
"obsidian"
"syncthing"
"newsboat"
"obs-studio"
"telegram-desktop"
)
pkg_nvidia=(
"nvidia"
"nvidia-utils"
)
pkg_desktop=(
"hypridle"
"hyprland"
"hyprlock"
"hyprpaper"
"hyprpicker"
"hyprpolkitagent"
"hyprshot"
"xdg-desktop-portal-hyprland"
"swaync"
"waybar"
)
pkg_aur=(
"envycontrol"
"htop-vim"
"jmtpfs"
"keepmenu"
"keyd-git"
"librewolf-bin"
"python-pywal16"
"tokyonight-gtk-theme-git"
"zsh-fast-syntax-highlighting-git"
)
# Install necessary desktop packages
## Install necessary desktop packages
source "$currentDir/packages/pkg_desktop.sh"
source "$currentDir/packages/pkg_utils.sh"
sudo pacman -S --needed "${pkg_desktop[@]}" "${pkg_utils[@]}"
# Install dev tools
read -rp "Do you wish to development tools? [y/n]" install_dev_tools
## Install dev tools
read -rp "Do you wish to install development tools? [y/N]" install_dev_tools
source "$currentDir/packages/pkg_dev_tools.sh"
if [[ $install_dev_tools == y ]]; then
sudo pacman -S --needed "${pkg_dev_tools[@]}"
fi
# Install optional packages
read -rp "Do you wish to install optional packages? [y/n]" install_optional_pkg
## Install optional packages
read -rp "Do you wish to install optional packages? [y/N]" install_optional_pkg
if [[ $install_optional_pkg == y ]]; then
source "$currentDir/packages/pkg_optional.sh"
sudo pacman -S --needed "${pkg_optional[@]}"
fi
# Install nvidia drivers
read -rp "Do you wish to install Nvidia drivers? [y/n]" install_nvidia_drivers
## Install nvidia drivers
read -rp "Do you wish to install Nvidia drivers? [y/N]" install_nvidia_drivers
if [[ $install_nvidia_drivers == y ]]; then
source "$currentDir/packages/pkg_nvidia.sh"
sudo pacman -S --needed "${pkg_nvidia[@]}"
fi
# Install aur packages
read -rp "Do you wish to install aur packages? [y/n]" install_aur_pkg
# Install paru if it isn't already installed
## Install aur packages
read -rp "Do you wish to install aur packages? [y/N]" install_aur_pkg
if [[ $install_aur_pkg == y ]]; then
## Install paru if it isn't already installed
if ! command -v paru >/dev/null 2>&1; then
echo "Installing paru..."
git clone https://aur.archlinux.org/paru-bin.git
@ -157,14 +44,15 @@ if [[ $install_aur_pkg == y ]]; then
else
echo "Skipping paru (already in PATH)"
fi
# Install aur packages
## Install aur packages
source "$currentDir/packages/pkg_aur.sh"
paru -S --needed "${pkg_aur[@]}"
fi
# Setup dotfiles
## Setup dotfiles
echo "⚠️ WARNING: This will DELETE any conflicting files and replace them with symlinks from this repo."
echo " Make sure your dotfiles repo is the source of truth / already backed up."
echo "Make sure you have already backed up all your existing config files (~/.config)"
read -rp "Continue with stow (y/N): " confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
echo "Detecting conflicts..."
@ -194,10 +82,11 @@ if [[ "$confirm" =~ ^[Yy]$ ]]; then
echo "✅ Dotfiles stowed with overwrite."
fi
else
echo "Aborted"
echo "Aborted stow"
fi
# Setup neovim dotfiles
## Setup neovim dotfiles
read -rp "Clone neovim dotfiles as well? (y/N): " confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
echo "Taking backup of neovim config (if already exists)"
@ -208,7 +97,7 @@ if [[ "$confirm" =~ ^[Yy]$ ]]; then
git clone --depth=1 git@github.com:krolyxon/nvim.git ~/.config/nvim
fi
# Change default shell to zsh
## Change default shell to zsh
if [[ "$SHELL" != "$(which zsh)" ]]; then
read -rp "Change default shell to ZSH? (y/N): " confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
@ -218,3 +107,8 @@ if [[ "$SHELL" != "$(which zsh)" ]]; then
else
echo "Skipping: zsh is already the default shell"
fi
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
echo ""
echo "Done! 😊"

14
packages/pkg_aur.sh Normal file
View File

@ -0,0 +1,14 @@
#!/bin/env bash
export pkg_aur=(
"envycontrol"
"htop-vim"
"jmtpfs"
"keepmenu"
"keyd-git"
"librewolf-bin"
"python-pywal16"
"tokyonight-gtk-theme-git"
"zsh-fast-syntax-highlighting-git"
)

14
packages/pkg_desktop.sh Normal file
View File

@ -0,0 +1,14 @@
#!/bin/env bash
export pkg_desktop=(
"hypridle"
"hyprland"
"hyprlock"
"hyprpaper"
"hyprpicker"
"hyprpolkitagent"
"hyprshot"
"xdg-desktop-portal-hyprland"
"swaync"
"waybar"
)

10
packages/pkg_dev_tools.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/env bash
export pkg_dev_tools=(
"git"
"neovim"
"platformio-core"
"tmux"
"nodejs"
"lazygit"
)

6
packages/pkg_nvidia.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/env bash
export pkg_nvidia=(
"nvidia"
"nvidia-utils"
)

10
packages/pkg_optional.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/env bash
export pkg_optional=(
"keepassxc"
"obsidian"
"syncthing"
"newsboat"
"obs-studio"
"telegram-desktop"
)

74
packages/pkg_utils.sh Normal file
View File

@ -0,0 +1,74 @@
#!/bin/env bash
export pkg_utils=(
"fd"
"ffmpegthumbnailer"
"foot"
"fuzzel"
"fzf"
"gammastep"
"ghostscript"
"gobject-introspection"
"gparted"
"grub"
"gvfs"
"gvfs-mtp"
"imagemagick"
"imlib2"
"jq"
"kanshi"
"lf"
"libnotify"
"libreoffice-fresh"
"lua"
"lvm2"
"man-db"
"meson"
"mpc"
"mpd"
"mpd-mpris"
"mpv"
"ncdu"
"ncmpcpp"
"ntfs-3g"
"nwg-look"
"pacman-contrib"
"pamixer"
"pavucontrol"
"pcmanfm"
"pipewire"
"pipewire-pulse"
"progress"
"python-gobject"
"python-pip"
"python-virtualenv"
"qpdf"
"reflector"
"ripgrep"
"rsync"
"sshfs"
"stow"
"tesseract"
"torbrowser-launcher"
"transmission-cli"
"noto-fonts"
"noto-fonts-cjk"
"noto-fonts-emoji"
"ttf-jetbrains-mono-nerd"
"tree"
"unzip"
"waybar"
"wget"
"woff2-font-awesome"
"wtype"
"xarchiver"
"xdg-user-dirs"
"yt-dlp"
"zathura"
"zathura-pdf-mupdf"
"zip"
"zola"
"zsh"
"zsh-autosuggestions"
)