From f332978bcd8bd9040cdd011ae4956c49c7067b54 Mon Sep 17 00:00:00 2001 From: nnduc Date: Thu, 26 Feb 2026 16:56:50 +0700 Subject: [PATCH] separate packages from the install script --- install-packages.sh | 84 +++++++++------------------------------------ packages.txt | 67 ++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 68 deletions(-) create mode 100644 packages.txt diff --git a/install-packages.sh b/install-packages.sh index d1a49ab..b116b7b 100644 --- a/install-packages.sh +++ b/install-packages.sh @@ -3,73 +3,21 @@ # --needed skips already-installed packages. # Only leaf packages are listed; dependencies are pulled in automatically. -packages=( - alacritty - base - base-devel - blueman - bluez-utils - clang - efibootmgr - extra-cmake-modules - fastfetch - fcitx5-configtool - fcitx5-gtk - feh - firefox - flameshot - git - grim - grub-btrfs - gst-plugin-pipewire - gvf - i3lock - i3-wm - inkscape - inotify-tools - krita - libreoffice-still - man-db - mousepad - neovim - net-tools - network-manager-applet - ninja - okular - pasystray - pavucontrol - pipewire-alsa - plasma-meta - polybar - pyright - python-pynvim - qt6-wayland - ranger - rofi - rust-analyzer - signal-desktop - slurp - snap-pac - sof-firmware - strawberry - sway - swaybg - swayidle - swaylock - syncthing - texlive-langother - texlive-meta - thunar - thunar-volman - thunderbird - tumbler - vala - waybar - wl-clipboard - xclip - zathura-pdf-mupdf - zram-generator - zsh -) +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PACKAGE_FILE="$SCRIPT_DIR/packages.txt" +if [[ ! -f "$PACKAGE_FILE" ]]; then + echo "Error: $PACKAGE_FILE not found" + exit 1 +fi + +# Read packages from file, skipping blank lines and comments +mapfile -t packages < <(grep -v '^\s*#' "$PACKAGE_FILE" | grep -v '^\s*$') + +if [[ ${#packages[@]} -eq 0 ]]; then + echo "No packages found in $PACKAGE_FILE" + exit 1 +fi + +echo "Installing ${#packages[@]} packages..." sudo pacman -S --needed "${packages[@]}" diff --git a/packages.txt b/packages.txt new file mode 100644 index 0000000..435e304 --- /dev/null +++ b/packages.txt @@ -0,0 +1,67 @@ +alacritty +base +base-devel +blueman +bluez-utils +clang +efibootmgr +extra-cmake-modules +fastfetch +fcitx5-configtool +fcitx5-gtk +feh +firefox +flameshot +git +grim +grub-btrfs +gst-plugin-pipewire +gvf +i3lock +i3-wm +inkscape +inotify-tools +kodi +krita +libreoffice-still +man-db +mousepad +neovim +net-tools +network-manager-applet +ninja +okular +pasystray +pavucontrol +pipewire-alsa +plasma-meta +polybar +pyright +python-pynvim +qt6-wayland +ranger +rofi +rust-analyzer +signal-desktop +slurp +snap-pac +sof-firmware +strawberry +sway +swaybg +swayidle +swaylock +syncthing +texlive-langother +texlive-meta +thunar +thunar-volman +thunderbird +tumbler +vala +waybar +wl-clipboard +xclip +zathura-pdf-mupdf +zram-generator +zsh