From b264b841bc6ee7b8beeeb2d068aba7d297877f76 Mon Sep 17 00:00:00 2001 From: Pinak Dhabu Date: Fri, 15 May 2026 10:14:12 +0530 Subject: [PATCH 1/7] Add 5 Arch system setup scripts: pacman config, pipewire, zram, snapper, maintenance --- core/tabs/system-setup/arch/pacman-config.sh | 43 +++++++++++++++++++ core/tabs/system-setup/arch/pipewire-setup.sh | 18 ++++++++ core/tabs/system-setup/arch/snapshot-setup.sh | 38 ++++++++++++++++ .../system-setup/arch/system-maintenance.sh | 36 ++++++++++++++++ core/tabs/system-setup/arch/zram-setup.sh | 31 +++++++++++++ core/tabs/system-setup/tab_data.toml | 35 +++++++++++++++ 6 files changed, 201 insertions(+) create mode 100644 core/tabs/system-setup/arch/pacman-config.sh create mode 100644 core/tabs/system-setup/arch/pipewire-setup.sh create mode 100644 core/tabs/system-setup/arch/snapshot-setup.sh create mode 100644 core/tabs/system-setup/arch/system-maintenance.sh create mode 100644 core/tabs/system-setup/arch/zram-setup.sh diff --git a/core/tabs/system-setup/arch/pacman-config.sh b/core/tabs/system-setup/arch/pacman-config.sh new file mode 100644 index 000000000..299ef903d --- /dev/null +++ b/core/tabs/system-setup/arch/pacman-config.sh @@ -0,0 +1,43 @@ +#!/bin/sh -e + +. ../../common-script.sh + +configurePacman() { + local conf="/etc/pacman.conf" + + if [ ! -f "$conf" ]; then + printf "%b\n" "${RED}${conf} not found.${RC}" + exit 1 + fi + + "$ESCALATION_TOOL" sed -i 's/^#Color/Color/' "$conf" + "$ESCALATION_TOOL" sed -i '/^Color/a ILoveCandy' "$conf" + "$ESCALATION_TOOL" sed -i 's/^#VerbosePkgLists/VerbosePkgLists/' "$conf" + "$ESCALATION_TOOL" sed -i 's/^#ParallelDownloads/ParallelDownloads/' "$conf" + if ! grep -q "^ParallelDownloads" "$conf"; then + printf "%b\n" "${YELLOW}Adding ParallelDownloads...${RC}" + "$ESCALATION_TOOL" sed -i '/^#ParallelDownloads/a ParallelDownloads = 5' "$conf" + fi + "$ESCALATION_TOOL" sed -i "/\[multilib\]/,/Include/"'s/^#//' "$conf" + + printf "%b\n" "${GREEN}pacman.conf configured: Color, ILoveCandy, VerbosePkgLists, ParallelDownloads=5, multilib enabled.${RC}" +} + +configureMakepkg() { + local conf="/etc/makepkg.conf" + local cores + + cores=$(nproc) + "$ESCALATION_TOOL" sed -i "s/^#MAKEFLAGS=\"-j[0-9]*\"/MAKEFLAGS=\"-j${cores}\"/" "$conf" + "$ESCALATION_TOOL" sed -i "s/^MAKEFLAGS=\"-j[0-9]*\"/MAKEFLAGS=\"-j${cores}\"/" "$conf" + if ! grep -q "^MAKEFLAGS" "$conf"; then + printf "%b\n" "${YELLOW}Adding MAKEFLAGS...${RC}" + printf "MAKEFLAGS=\"-j%s\"\n" "$cores" | "$ESCALATION_TOOL" tee -a "$conf" > /dev/null + fi + printf "%b\n" "${GREEN}MAKEFLAGS set to -j${cores} in makepkg.conf${RC}" +} + +checkEnv +checkEscalationTool +configurePacman +configureMakepkg diff --git a/core/tabs/system-setup/arch/pipewire-setup.sh b/core/tabs/system-setup/arch/pipewire-setup.sh new file mode 100644 index 000000000..38a5be46d --- /dev/null +++ b/core/tabs/system-setup/arch/pipewire-setup.sh @@ -0,0 +1,18 @@ +#!/bin/sh -e + +. ../../common-script.sh + +installPipewire() { + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm pipewire pipewire-pulse pipewire-alsa pipewire-jack wireplumber lib32-pipewire + + if command_exists systemctl; then + systemctl --user enable --now pipewire.service pipewire-pulse.service wireplumber.service 2>/dev/null || true + printf "%b\n" "${GREEN}PipeWire services enabled.${RC}" + fi + + printf "%b\n" "${GREEN}PipeWire with WirePlumber installed. Reboot or relogin to apply.${RC}" +} + +checkEnv +checkEscalationTool +installPipewire diff --git a/core/tabs/system-setup/arch/snapshot-setup.sh b/core/tabs/system-setup/arch/snapshot-setup.sh new file mode 100644 index 000000000..8bc58880d --- /dev/null +++ b/core/tabs/system-setup/arch/snapshot-setup.sh @@ -0,0 +1,38 @@ +#!/bin/sh -e + +. ../../common-script.sh + +checkBtrfs() { + if ! command_exists btrfs; then + printf "%b\n" "${RED}btrfs-progs not installed. Install it first.${RC}" + exit 1 + fi + + if ! mount | grep -q "btrfs"; then + printf "%b\n" "${RED}No Btrfs filesystem detected. Snapshots require Btrfs.${RC}" + exit 1 + fi +} + +setupSnapper() { + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm snapper snap-pac grub-btrfs + + if [ -d "/.snapshots" ] && mountpoint -q "/.snapshots"; then + "$ESCALATION_TOOL" umount /.snapshots 2>/dev/null || true + fi + "$ESCALATION_TOOL" rm -rf /.snapshots 2>/dev/null || true + + "$ESCALATION_TOOL" snapper -c root create-config / + + "$ESCALATION_TOOL" systemctl enable --now snapper-timeline.timer snapper-cleanup.timer 2>/dev/null || true + "$ESCALATION_TOOL" systemctl enable --now grub-btrfsd 2>/dev/null || true + + printf "%b\n" "${GREEN}Snapper configured with hourly snapshots.${RC}" + printf "%b\n" "${GREEN}snap-pac installed (auto snapshots on pacman operations).${RC}" + printf "%b\n" "${GREEN}grub-btrfs installed (boot into snapshots from GRUB menu).${RC}" +} + +checkEnv +checkEscalationTool +checkBtrfs +setupSnapper diff --git a/core/tabs/system-setup/arch/system-maintenance.sh b/core/tabs/system-setup/arch/system-maintenance.sh new file mode 100644 index 000000000..12488021b --- /dev/null +++ b/core/tabs/system-setup/arch/system-maintenance.sh @@ -0,0 +1,36 @@ +#!/bin/sh -e + +. ../../common-script.sh + +setupPaccache() { + if ! command_exists paccache; then + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm pacman-contrib + fi + + "$ESCALATION_TOOL" systemctl enable --now paccache.timer 2>/dev/null || true + printf "%b\n" "${GREEN}paccache.timer enabled (weekly cache cleanup).${RC}" +} + +removeOrphans() { + local orphans + orphans=$(pacman -Qtdq 2>/dev/null || true) + if [ -n "$orphans" ]; then + printf "%b\n" "${YELLOW}Removing orphan packages...${RC}" + printf "%s\n" "$orphans" + "$ESCALATION_TOOL" "$PACKAGER" -Rns --noconfirm $orphans 2>/dev/null || true + else + printf "%b\n" "${GREEN}No orphan packages found.${RC}" + fi +} + +cleanJournal() { + "$ESCALATION_TOOL" journalctl --vacuum-time=30d 2>/dev/null || true + printf "%b\n" "${GREEN}System journal trimmed to 30 days.${RC}" +} + +printf "%b\n" "${YELLOW}Arch System Maintenance${RC}" +checkEnv +checkEscalationTool +setupPaccache +removeOrphans +cleanJournal diff --git a/core/tabs/system-setup/arch/zram-setup.sh b/core/tabs/system-setup/arch/zram-setup.sh new file mode 100644 index 000000000..3ed4edf2b --- /dev/null +++ b/core/tabs/system-setup/arch/zram-setup.sh @@ -0,0 +1,31 @@ +#!/bin/sh -e + +. ../../common-script.sh + +setupZram() { + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm zram-generator + + local conf="/etc/systemd/zram-generator.conf" + "$ESCALATION_TOOL" tee "$conf" > /dev/null << 'EOF' +[zram0] +zram-size = ram / 2 +compression-algorithm = zstd +swap-priority = 100 +EOF + + "$ESCALATION_TOOL" systemctl daemon-reexec + "$ESCALATION_TOOL" systemctl start systemd-zram-setup@zram0 2>/dev/null || true + + local sysctl_conf="/etc/sysctl.d/99-vm-zram-parameters.conf" + "$ESCALATION_TOOL" tee "$sysctl_conf" > /dev/null << 'EOF' +vm.swappiness = 10 +vm.vfs_cache_pressure = 50 +EOF + + printf "%b\n" "${GREEN}zram configured: zstd compression, swappiness=10.${RC}" + printf "%b\n" "${YELLOW}Reboot or run: sudo systemctl start systemd-zram-setup@zram0${RC}" +} + +checkEnv +checkEscalationTool +setupZram diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index decacca59..e19817105 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -97,6 +97,41 @@ description = "Yet Another Yogurt - An AUR Helper Written in Go. To know more ab script = "arch/yay-setup.sh" task_list = "I" +[[data.entries]] +name = "Pacman Config" +description = "Enables Color, ILoveCandy, ParallelDownloads, VerbosePkgLists, multilib in pacman.conf and sets MAKEFLAGS in makepkg.conf." +script = "arch/pacman-config.sh" +task_list = "PFM" + +[[data.entries]] +name = "PipeWire Audio" +description = "Installs PipeWire with WirePlumber session manager for audio (replaces PulseAudio)." +script = "arch/pipewire-setup.sh" +task_list = "I" + +[[data.entries]] +name = "Zram Swap" +description = "Configures compressed RAM swap via zram-generator with zstd algorithm." +script = "arch/zram-setup.sh" +task_list = "PFM" + +[[data.entries]] +name = "Snapper Snapshots" +description = "Sets up Snapper with hourly Btrfs snapshots, snap-pac hooks, and GRUB boot menu entries." +script = "arch/snapshot-setup.sh" +task_list = "I PFM SS" + +[[data.entries.preconditions]] +matches = true +data = "command_exists" +values = ["btrfs"] + +[[data.entries]] +name = "System Maintenance" +description = "Enables paccache.timer, removes orphan packages, and cleans system journals." +script = "arch/system-maintenance.sh" +task_list = "PFM RP" + [[data]] name = "Debian" From deb36cfb06a727ec5944f3e0374b7e640fc4c0ac Mon Sep 17 00:00:00 2001 From: Pinak Dhabu Date: Sun, 24 May 2026 17:39:49 +0530 Subject: [PATCH 2/7] Fix shellcheck issues: remove local/bashisms, add snapper safety guard --- core/tabs/system-setup/arch/pacman-config.sh | 6 ++---- core/tabs/system-setup/arch/pipewire-setup.sh | 1 - core/tabs/system-setup/arch/snapshot-setup.sh | 21 +++++++++++++++---- .../system-setup/arch/system-maintenance.sh | 4 +--- core/tabs/system-setup/arch/zram-setup.sh | 5 ++--- 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/core/tabs/system-setup/arch/pacman-config.sh b/core/tabs/system-setup/arch/pacman-config.sh index 299ef903d..81a2c3098 100644 --- a/core/tabs/system-setup/arch/pacman-config.sh +++ b/core/tabs/system-setup/arch/pacman-config.sh @@ -3,7 +3,7 @@ . ../../common-script.sh configurePacman() { - local conf="/etc/pacman.conf" + conf="/etc/pacman.conf" if [ ! -f "$conf" ]; then printf "%b\n" "${RED}${conf} not found.${RC}" @@ -24,8 +24,7 @@ configurePacman() { } configureMakepkg() { - local conf="/etc/makepkg.conf" - local cores + conf="/etc/makepkg.conf" cores=$(nproc) "$ESCALATION_TOOL" sed -i "s/^#MAKEFLAGS=\"-j[0-9]*\"/MAKEFLAGS=\"-j${cores}\"/" "$conf" @@ -38,6 +37,5 @@ configureMakepkg() { } checkEnv -checkEscalationTool configurePacman configureMakepkg diff --git a/core/tabs/system-setup/arch/pipewire-setup.sh b/core/tabs/system-setup/arch/pipewire-setup.sh index 38a5be46d..30684e6ed 100644 --- a/core/tabs/system-setup/arch/pipewire-setup.sh +++ b/core/tabs/system-setup/arch/pipewire-setup.sh @@ -14,5 +14,4 @@ installPipewire() { } checkEnv -checkEscalationTool installPipewire diff --git a/core/tabs/system-setup/arch/snapshot-setup.sh b/core/tabs/system-setup/arch/snapshot-setup.sh index 8bc58880d..645a5810c 100644 --- a/core/tabs/system-setup/arch/snapshot-setup.sh +++ b/core/tabs/system-setup/arch/snapshot-setup.sh @@ -17,10 +17,24 @@ checkBtrfs() { setupSnapper() { "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm snapper snap-pac grub-btrfs - if [ -d "/.snapshots" ] && mountpoint -q "/.snapshots"; then - "$ESCALATION_TOOL" umount /.snapshots 2>/dev/null || true + if [ -f "/etc/snapper/configs/root" ]; then + printf "%s\n" "${RED}Error: Existing Snapper 'root' configuration detected. Aborting.${RC}" >&2 + exit 1 + fi + + if mountpoint -q "/.snapshots"; then + printf "%s\n" "${RED}Error: /.snapshots is actively mounted. Aborting.${RC}" >&2 + exit 1 + fi + + if [ -d "/.snapshots" ]; then + if "$ESCALATION_TOOL" rmdir "/.snapshots" 2>/dev/null; then + printf "%s\n" "${GREEN}Removed empty /.snapshots directory.${RC}" + else + printf "%s\n" "${RED}Error: /.snapshots exists and is not empty or could not be removed. Aborting to avoid data loss.${RC}" >&2 + exit 1 + fi fi - "$ESCALATION_TOOL" rm -rf /.snapshots 2>/dev/null || true "$ESCALATION_TOOL" snapper -c root create-config / @@ -33,6 +47,5 @@ setupSnapper() { } checkEnv -checkEscalationTool checkBtrfs setupSnapper diff --git a/core/tabs/system-setup/arch/system-maintenance.sh b/core/tabs/system-setup/arch/system-maintenance.sh index 12488021b..20abea1c4 100644 --- a/core/tabs/system-setup/arch/system-maintenance.sh +++ b/core/tabs/system-setup/arch/system-maintenance.sh @@ -12,12 +12,11 @@ setupPaccache() { } removeOrphans() { - local orphans orphans=$(pacman -Qtdq 2>/dev/null || true) if [ -n "$orphans" ]; then printf "%b\n" "${YELLOW}Removing orphan packages...${RC}" printf "%s\n" "$orphans" - "$ESCALATION_TOOL" "$PACKAGER" -Rns --noconfirm $orphans 2>/dev/null || true + printf "%s\n" "$orphans" | "$ESCALATION_TOOL" xargs "$PACKAGER" -Rns --noconfirm 2>/dev/null || true else printf "%b\n" "${GREEN}No orphan packages found.${RC}" fi @@ -30,7 +29,6 @@ cleanJournal() { printf "%b\n" "${YELLOW}Arch System Maintenance${RC}" checkEnv -checkEscalationTool setupPaccache removeOrphans cleanJournal diff --git a/core/tabs/system-setup/arch/zram-setup.sh b/core/tabs/system-setup/arch/zram-setup.sh index 3ed4edf2b..5c0eedd3f 100644 --- a/core/tabs/system-setup/arch/zram-setup.sh +++ b/core/tabs/system-setup/arch/zram-setup.sh @@ -5,7 +5,7 @@ setupZram() { "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm zram-generator - local conf="/etc/systemd/zram-generator.conf" + conf="/etc/systemd/zram-generator.conf" "$ESCALATION_TOOL" tee "$conf" > /dev/null << 'EOF' [zram0] zram-size = ram / 2 @@ -16,7 +16,7 @@ EOF "$ESCALATION_TOOL" systemctl daemon-reexec "$ESCALATION_TOOL" systemctl start systemd-zram-setup@zram0 2>/dev/null || true - local sysctl_conf="/etc/sysctl.d/99-vm-zram-parameters.conf" + sysctl_conf="/etc/sysctl.d/99-vm-zram-parameters.conf" "$ESCALATION_TOOL" tee "$sysctl_conf" > /dev/null << 'EOF' vm.swappiness = 10 vm.vfs_cache_pressure = 50 @@ -27,5 +27,4 @@ EOF } checkEnv -checkEscalationTool setupZram From 630bfefd931b031d221805ebb1be73ea50138868 Mon Sep 17 00:00:00 2001 From: Pinak Dhabu Date: Sun, 24 May 2026 18:03:10 +0530 Subject: [PATCH 3/7] fix: 3 Arch-related script fixes - #1067: Simplify waydroid kernel grep to avoid ERE syntax issues - #1255: Use package manager for starship/fzf/zoxide before curl fallback - #1220: Auto-run grub-mkconfig after GRUB theme installation Closes #1067, #1255, #1220 --- core/tabs/applications-setup/grub-theme.sh | 5 ++ core/tabs/applications-setup/mybash-setup.sh | 53 ++++++++++++------- .../tabs/applications-setup/waydroid-setup.sh | 2 +- 3 files changed, 39 insertions(+), 21 deletions(-) diff --git a/core/tabs/applications-setup/grub-theme.sh b/core/tabs/applications-setup/grub-theme.sh index 754363047..06787b3d1 100644 --- a/core/tabs/applications-setup/grub-theme.sh +++ b/core/tabs/applications-setup/grub-theme.sh @@ -11,6 +11,11 @@ themeinstall(){ git clone "https://github.com/ChrisTitusTech/Top-5-Bootloader-Themes" cd "Top-5-Bootloader-Themes" "$ESCALATION_TOOL" ./install.sh + if command -v grub-mkconfig >/dev/null 2>&1; then + "$ESCALATION_TOOL" grub-mkconfig -o /boot/grub/grub.cfg + elif command -v grub2-mkconfig >/dev/null 2>&1; then + "$ESCALATION_TOOL" grub2-mkconfig -o /boot/grub2/grub.cfg + fi } checkEnv diff --git a/core/tabs/applications-setup/mybash-setup.sh b/core/tabs/applications-setup/mybash-setup.sh index b03a470af..03be971ac 100644 --- a/core/tabs/applications-setup/mybash-setup.sh +++ b/core/tabs/applications-setup/mybash-setup.sh @@ -54,29 +54,38 @@ installFont() { fi } +_install_pkg() { + case "$PACKAGER" in + pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$1" ;; + apk) "$ESCALATION_TOOL" "$PACKAGER" add "$1" ;; + xbps-install) "$ESCALATION_TOOL" "$PACKAGER" -Sy "$1" ;; + *) "$ESCALATION_TOOL" "$PACKAGER" install -y "$1" ;; + esac +} + installStarshipAndFzf() { - if command_exists starship; then + if ! command_exists starship; then + printf "%b\n" "${YELLOW}Installing Starship...${RC}" + _install_pkg starship 2>/dev/null || { + printf "%b\n" "${YELLOW}Package manager install failed, using curl...${RC}" + curl -sSL https://starship.rs/install.sh | "$ESCALATION_TOOL" sh || { + printf "%b\n" "${RED}Failed to install starship!${RC}" + exit 1 + } + } + else printf "%b\n" "${GREEN}Starship already installed${RC}" - return fi - if [ "$PACKAGER" = "eopkg" ]; then - "$ESCALATION_TOOL" "$PACKAGER" install -y starship || { - printf "%b\n" "${RED}Failed to install starship with Solus!${RC}" - exit 1 + if ! command_exists fzf; then + printf "%b\n" "${YELLOW}Installing fzf...${RC}" + _install_pkg fzf 2>/dev/null || { + printf "%b\n" "${YELLOW}Package manager install failed, using git...${RC}" + git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf + "$ESCALATION_TOOL" ~/.fzf/install } else - curl -sSL https://starship.rs/install.sh | "$ESCALATION_TOOL" sh || { - printf "%b\n" "${RED}Failed to install starship!${RC}" - exit 1 - } - fi - - if command_exists fzf; then printf "%b\n" "${GREEN}Fzf already installed${RC}" - else - git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf - "$ESCALATION_TOOL" ~/.fzf/install fi } @@ -86,10 +95,14 @@ installZoxide() { return fi - if ! curl -sSL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh; then - printf "%b\n" "${RED}Something went wrong during zoxide install!${RC}" - exit 1 - fi + printf "%b\n" "${YELLOW}Installing Zoxide...${RC}" + _install_pkg zoxide 2>/dev/null || { + printf "%b\n" "${YELLOW}Package manager install failed, using curl...${RC}" + if ! curl -sSL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh; then + printf "%b\n" "${RED}Something went wrong during zoxide install!${RC}" + exit 1 + fi + } } linkConfig() { diff --git a/core/tabs/applications-setup/waydroid-setup.sh b/core/tabs/applications-setup/waydroid-setup.sh index 2caffe9b3..71f6add21 100755 --- a/core/tabs/applications-setup/waydroid-setup.sh +++ b/core/tabs/applications-setup/waydroid-setup.sh @@ -20,7 +20,7 @@ installWaydroid() { "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm dkms fi - installed_kernels=$("$PACKAGER" -Q | grep -E '^linux(| |-rt|-rt-lts|-hardened|-zen|-lts)[^-headers]' | cut -d ' ' -f 1) + installed_kernels=$("$PACKAGER" -Q | grep '^linux' | grep -v '\-headers' | grep -v '\-firmware' | cut -d ' ' -f 1) for kernel in $installed_kernels; do header="${kernel}-headers" printf "%b\n" "${CYAN}Installing headers for $kernel...${RC}" From 07490baee45c628342d46092c4469cd22ba14110 Mon Sep 17 00:00:00 2001 From: Pinak Dhabu Date: Mon, 25 May 2026 11:58:56 +0530 Subject: [PATCH 4/7] refactor: move pipewire/zram scripts to system-setup root with cross-distro support --- core/tabs/system-setup/arch/pipewire-setup.sh | 17 ------ core/tabs/system-setup/arch/zram-setup.sh | 30 ---------- core/tabs/system-setup/pipewire-setup.sh | 48 +++++++++++++++ core/tabs/system-setup/tab_data.toml | 24 ++++---- core/tabs/system-setup/zram-setup.sh | 60 +++++++++++++++++++ 5 files changed, 120 insertions(+), 59 deletions(-) delete mode 100644 core/tabs/system-setup/arch/pipewire-setup.sh delete mode 100644 core/tabs/system-setup/arch/zram-setup.sh create mode 100644 core/tabs/system-setup/pipewire-setup.sh create mode 100644 core/tabs/system-setup/zram-setup.sh diff --git a/core/tabs/system-setup/arch/pipewire-setup.sh b/core/tabs/system-setup/arch/pipewire-setup.sh deleted file mode 100644 index 30684e6ed..000000000 --- a/core/tabs/system-setup/arch/pipewire-setup.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -e - -. ../../common-script.sh - -installPipewire() { - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm pipewire pipewire-pulse pipewire-alsa pipewire-jack wireplumber lib32-pipewire - - if command_exists systemctl; then - systemctl --user enable --now pipewire.service pipewire-pulse.service wireplumber.service 2>/dev/null || true - printf "%b\n" "${GREEN}PipeWire services enabled.${RC}" - fi - - printf "%b\n" "${GREEN}PipeWire with WirePlumber installed. Reboot or relogin to apply.${RC}" -} - -checkEnv -installPipewire diff --git a/core/tabs/system-setup/arch/zram-setup.sh b/core/tabs/system-setup/arch/zram-setup.sh deleted file mode 100644 index 5c0eedd3f..000000000 --- a/core/tabs/system-setup/arch/zram-setup.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -e - -. ../../common-script.sh - -setupZram() { - "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm zram-generator - - conf="/etc/systemd/zram-generator.conf" - "$ESCALATION_TOOL" tee "$conf" > /dev/null << 'EOF' -[zram0] -zram-size = ram / 2 -compression-algorithm = zstd -swap-priority = 100 -EOF - - "$ESCALATION_TOOL" systemctl daemon-reexec - "$ESCALATION_TOOL" systemctl start systemd-zram-setup@zram0 2>/dev/null || true - - sysctl_conf="/etc/sysctl.d/99-vm-zram-parameters.conf" - "$ESCALATION_TOOL" tee "$sysctl_conf" > /dev/null << 'EOF' -vm.swappiness = 10 -vm.vfs_cache_pressure = 50 -EOF - - printf "%b\n" "${GREEN}zram configured: zstd compression, swappiness=10.${RC}" - printf "%b\n" "${YELLOW}Reboot or run: sudo systemctl start systemd-zram-setup@zram0${RC}" -} - -checkEnv -setupZram diff --git a/core/tabs/system-setup/pipewire-setup.sh b/core/tabs/system-setup/pipewire-setup.sh new file mode 100644 index 000000000..e139df142 --- /dev/null +++ b/core/tabs/system-setup/pipewire-setup.sh @@ -0,0 +1,48 @@ +#!/bin/sh -e + +. ../common-script.sh + +installPipewirePkgs() { + case "$PACKAGER" in + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm pipewire pipewire-pulse pipewire-alsa pipewire-jack wireplumber lib32-pipewire + ;; + apt-get|nala) + "$ESCALATION_TOOL" "$PACKAGER" update + "$ESCALATION_TOOL" "$PACKAGER" install -y pipewire pipewire-pulse wireplumber pipewire-audio-client-libraries 2>/dev/null || \ + "$ESCALATION_TOOL" "$PACKAGER" install -y pipewire pipewire-pulse wireplumber + ;; + dnf) + "$ESCALATION_TOOL" "$PACKAGER" install -y pipewire pipewire-pulse wireplumber pipewire-jack-audio-connection-kit + ;; + zypper) + "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install pipewire pipewire-pulse wireplumber pipewire-jack + ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add pipewire pipewire-pulse wireplumber + ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy pipewire pipewire-pulse wireplumber + ;; + eopkg) + "$ESCALATION_TOOL" "$PACKAGER" install -y pipewire wireplumber + ;; + *) + "$ESCALATION_TOOL" "$PACKAGER" install -y pipewire wireplumber + ;; + esac +} + +installPipewire() { + installPipewirePkgs + + if command_exists systemctl; then + "$ESCALATION_TOOL" systemctl --user enable --now pipewire.service pipewire-pulse.service wireplumber.service 2>/dev/null || true + printf "%b\n" "${GREEN}PipeWire services enabled.${RC}" + fi + + printf "%b\n" "${GREEN}PipeWire with WirePlumber installed. Reboot or relogin to apply.${RC}" +} + +checkEnv +installPipewire diff --git a/core/tabs/system-setup/tab_data.toml b/core/tabs/system-setup/tab_data.toml index e19817105..0f679dd4a 100644 --- a/core/tabs/system-setup/tab_data.toml +++ b/core/tabs/system-setup/tab_data.toml @@ -103,18 +103,6 @@ description = "Enables Color, ILoveCandy, ParallelDownloads, VerbosePkgLists, mu script = "arch/pacman-config.sh" task_list = "PFM" -[[data.entries]] -name = "PipeWire Audio" -description = "Installs PipeWire with WirePlumber session manager for audio (replaces PulseAudio)." -script = "arch/pipewire-setup.sh" -task_list = "I" - -[[data.entries]] -name = "Zram Swap" -description = "Configures compressed RAM swap via zram-generator with zstd algorithm." -script = "arch/zram-setup.sh" -task_list = "PFM" - [[data.entries]] name = "Snapper Snapshots" description = "Sets up Snapper with hourly Btrfs snapshots, snap-pac hooks, and GRUB boot menu entries." @@ -285,3 +273,15 @@ name = "TTY Fonts" description = "This Script will set the default TTY font to Terminus size 32 Bold" script = "terminus-tty.sh" task_list = "I PFM" + +[[data]] +name = "PipeWire Audio" +description = "Installs PipeWire with WirePlumber session manager for audio (replaces PulseAudio)." +script = "pipewire-setup.sh" +task_list = "I" + +[[data]] +name = "Zram Swap" +description = "Configures compressed RAM swap via zram-generator with zstd algorithm." +script = "zram-setup.sh" +task_list = "PFM" diff --git a/core/tabs/system-setup/zram-setup.sh b/core/tabs/system-setup/zram-setup.sh new file mode 100644 index 000000000..8447522cf --- /dev/null +++ b/core/tabs/system-setup/zram-setup.sh @@ -0,0 +1,60 @@ +#!/bin/sh -e + +. ../common-script.sh + +installZramPkg() { + case "$PACKAGER" in + pacman) + "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm zram-generator + ;; + apt-get|nala) + "$ESCALATION_TOOL" "$PACKAGER" update + "$ESCALATION_TOOL" "$PACKAGER" install -y systemd-zram-generator + ;; + dnf) + "$ESCALATION_TOOL" "$PACKAGER" install -y zram-generator + ;; + zypper) + "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install zram-generator + ;; + apk) + "$ESCALATION_TOOL" "$PACKAGER" add zram-generator + ;; + xbps-install) + "$ESCALATION_TOOL" "$PACKAGER" -Sy zram-generator + ;; + eopkg) + "$ESCALATION_TOOL" "$PACKAGER" install -y zram-generator + ;; + *) + "$ESCALATION_TOOL" "$PACKAGER" install -y zram-generator + ;; + esac +} + +setupZram() { + installZramPkg + + conf="/etc/systemd/zram-generator.conf" + "$ESCALATION_TOOL" tee "$conf" > /dev/null << 'EOF' +[zram0] +zram-size = ram / 2 +compression-algorithm = zstd +swap-priority = 100 +EOF + + "$ESCALATION_TOOL" systemctl daemon-reexec + "$ESCALATION_TOOL" systemctl start systemd-zram-setup@zram0 2>/dev/null || true + + sysctl_conf="/etc/sysctl.d/99-vm-zram-parameters.conf" + "$ESCALATION_TOOL" tee "$sysctl_conf" > /dev/null << 'EOF' +vm.swappiness = 10 +vm.vfs_cache_pressure = 50 +EOF + + printf "%b\n" "${GREEN}zram configured: zstd compression, swappiness=10.${RC}" + printf "%b\n" "${YELLOW}Reboot or run: sudo systemctl start systemd-zram-setup@zram0${RC}" +} + +checkEnv +setupZram From 022e9be62b187f9500175dced0e425a2d981eb24 Mon Sep 17 00:00:00 2001 From: Pinak Dhabu Date: Mon, 25 May 2026 12:16:59 +0530 Subject: [PATCH 5/7] fix: bump ParallelDownloads to 20 in pacman config --- core/tabs/system-setup/arch/pacman-config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/system-setup/arch/pacman-config.sh b/core/tabs/system-setup/arch/pacman-config.sh index 81a2c3098..b04e38a1f 100644 --- a/core/tabs/system-setup/arch/pacman-config.sh +++ b/core/tabs/system-setup/arch/pacman-config.sh @@ -16,7 +16,7 @@ configurePacman() { "$ESCALATION_TOOL" sed -i 's/^#ParallelDownloads/ParallelDownloads/' "$conf" if ! grep -q "^ParallelDownloads" "$conf"; then printf "%b\n" "${YELLOW}Adding ParallelDownloads...${RC}" - "$ESCALATION_TOOL" sed -i '/^#ParallelDownloads/a ParallelDownloads = 5' "$conf" + "$ESCALATION_TOOL" sed -i '/^#ParallelDownloads/a ParallelDownloads = 20' "$conf" fi "$ESCALATION_TOOL" sed -i "/\[multilib\]/,/Include/"'s/^#//' "$conf" From 54ff34cdf8cc366d1102daf70c2bd4f0f14b4f09 Mon Sep 17 00:00:00 2001 From: Pinak Dhabu Date: Mon, 25 May 2026 16:51:06 +0530 Subject: [PATCH 6/7] fix: explicitly list known pkg managers in _install_pkg, note unsupported in fallback --- core/tabs/applications-setup/mybash-setup.sh | 3 ++- core/tabs/system-setup/pipewire-setup.sh | 3 ++- core/tabs/system-setup/zram-setup.sh | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/tabs/applications-setup/mybash-setup.sh b/core/tabs/applications-setup/mybash-setup.sh index 03be971ac..6c143a233 100644 --- a/core/tabs/applications-setup/mybash-setup.sh +++ b/core/tabs/applications-setup/mybash-setup.sh @@ -59,7 +59,8 @@ _install_pkg() { pacman) "$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$1" ;; apk) "$ESCALATION_TOOL" "$PACKAGER" add "$1" ;; xbps-install) "$ESCALATION_TOOL" "$PACKAGER" -Sy "$1" ;; - *) "$ESCALATION_TOOL" "$PACKAGER" install -y "$1" ;; + dnf|apt-get|nala|zypper|eopkg) "$ESCALATION_TOOL" "$PACKAGER" install -y "$1" ;; + *) printf "%b\n" "${YELLOW}Unsupported package manager, falling back to manual install...${RC}" && return 1 ;; esac } diff --git a/core/tabs/system-setup/pipewire-setup.sh b/core/tabs/system-setup/pipewire-setup.sh index e139df142..04204844c 100644 --- a/core/tabs/system-setup/pipewire-setup.sh +++ b/core/tabs/system-setup/pipewire-setup.sh @@ -28,7 +28,8 @@ installPipewirePkgs() { "$ESCALATION_TOOL" "$PACKAGER" install -y pipewire wireplumber ;; *) - "$ESCALATION_TOOL" "$PACKAGER" install -y pipewire wireplumber + printf "%b\n" "${RED}Unsupported package manager: $PACKAGER. Install pipewire and wireplumber manually.${RC}" + exit 1 ;; esac } diff --git a/core/tabs/system-setup/zram-setup.sh b/core/tabs/system-setup/zram-setup.sh index 8447522cf..11202ebe7 100644 --- a/core/tabs/system-setup/zram-setup.sh +++ b/core/tabs/system-setup/zram-setup.sh @@ -27,7 +27,8 @@ installZramPkg() { "$ESCALATION_TOOL" "$PACKAGER" install -y zram-generator ;; *) - "$ESCALATION_TOOL" "$PACKAGER" install -y zram-generator + printf "%b\n" "${RED}Unsupported package manager: $PACKAGER. Install zram-generator manually.${RC}" + exit 1 ;; esac } From 08811527d80925806fc257d340549a126b24161b Mon Sep 17 00:00:00 2001 From: Pinak Dhabu Date: Tue, 26 May 2026 00:15:52 +0530 Subject: [PATCH 7/7] fix: add pipewire-jack for Debian 13+, rename pipewire-pulse to pipewire-pulseaudio for Fedora --- core/tabs/system-setup/pipewire-setup.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/tabs/system-setup/pipewire-setup.sh b/core/tabs/system-setup/pipewire-setup.sh index 04204844c..6154eff81 100644 --- a/core/tabs/system-setup/pipewire-setup.sh +++ b/core/tabs/system-setup/pipewire-setup.sh @@ -9,12 +9,14 @@ installPipewirePkgs() { ;; apt-get|nala) "$ESCALATION_TOOL" "$PACKAGER" update - "$ESCALATION_TOOL" "$PACKAGER" install -y pipewire pipewire-pulse wireplumber pipewire-audio-client-libraries 2>/dev/null || \ - "$ESCALATION_TOOL" "$PACKAGER" install -y pipewire pipewire-pulse wireplumber + "$ESCALATION_TOOL" "$PACKAGER" install -y pipewire pipewire-pulse wireplumber pipewire-jack pipewire-audio-client-libraries 2>/dev/null || \ + "$ESCALATION_TOOL" "$PACKAGER" install -y pipewire pipewire-pulse wireplumber pipewire-jack ;; + dnf) - "$ESCALATION_TOOL" "$PACKAGER" install -y pipewire pipewire-pulse wireplumber pipewire-jack-audio-connection-kit + "$ESCALATION_TOOL" "$PACKAGER" install -y pipewire pipewire-pulseaudio wireplumber pipewire-jack-audio-connection-kit ;; + zypper) "$ESCALATION_TOOL" "$PACKAGER" --non-interactive install pipewire pipewire-pulse wireplumber pipewire-jack ;;