Skip to content
5 changes: 5 additions & 0 deletions core/tabs/applications-setup/grub-theme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
53 changes: 33 additions & 20 deletions core/tabs/applications-setup/mybash-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" ;;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend change *) to dnf|apt-get|nala|zypper, and using * for flatpak(if available) or note of unsupported package manager

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
}

Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion core/tabs/applications-setup/waydroid-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
41 changes: 41 additions & 0 deletions core/tabs/system-setup/arch/pacman-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh -e

. ../../common-script.sh

configurePacman() {
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() {
conf="/etc/makepkg.conf"

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
configurePacman
configureMakepkg
17 changes: 17 additions & 0 deletions core/tabs/system-setup/arch/pipewire-setup.sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pipewire is available on most distros and this should also be updated and moved into system-setup root folder

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/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
51 changes: 51 additions & 0 deletions core/tabs/system-setup/arch/snapshot-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/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 [ -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" 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
checkBtrfs
setupSnapper
34 changes: 34 additions & 0 deletions core/tabs/system-setup/arch/system-maintenance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/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() {
orphans=$(pacman -Qtdq 2>/dev/null || true)
if [ -n "$orphans" ]; then
printf "%b\n" "${YELLOW}Removing orphan packages...${RC}"
printf "%s\n" "$orphans"
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
}

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
setupPaccache
removeOrphans
cleanJournal
30 changes: 30 additions & 0 deletions core/tabs/system-setup/arch/zram-setup.sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zram-generator is available for other distros. Makes sense to add them to this and move this outside the arch folder. I think this makes more sense in the utilities folder. @Abs313a @koibtw Thoughts?

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/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
35 changes: 35 additions & 0 deletions core/tabs/system-setup/tab_data.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Loading