From 2f63f0029487049f4ebd7e9440e70213a650adb2 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Thu, 15 Aug 2024 16:23:21 -0500 Subject: [PATCH] Initial Commit --- src/commands/system-setup/arch/paru-setup.sh | 25 ++++++++++++++++++++ src/commands/system-setup/arch/yay-setup.sh | 25 ++++++++++++++++++++ src/tabs.rs | 13 ++++++++++ 3 files changed, 63 insertions(+) create mode 100644 src/commands/system-setup/arch/paru-setup.sh create mode 100644 src/commands/system-setup/arch/yay-setup.sh diff --git a/src/commands/system-setup/arch/paru-setup.sh b/src/commands/system-setup/arch/paru-setup.sh new file mode 100644 index 00000000..2a96f2fc --- /dev/null +++ b/src/commands/system-setup/arch/paru-setup.sh @@ -0,0 +1,25 @@ +#!/bin/sh -e + +. "$(dirname "$0")/../../common-script.sh" + +installDepend() { + case $PACKAGER in + pacman) + if ! command_exists paru; then + echo "Installing paru as AUR helper..." + sudo "$PACKAGER" --noconfirm -S base-devel + cd /opt && sudo git clone https://aur.archlinux.org/paru.git && sudo chown -R "$USER": ./paru + cd paru && makepkg --noconfirm -si + echo "Paru installed" + else + echo "Paru already installed" + fi + ;; + *) + echo "Unsupported package manager: $PACKAGER" + ;; + esac +} + +checkEnv +installDepend \ No newline at end of file diff --git a/src/commands/system-setup/arch/yay-setup.sh b/src/commands/system-setup/arch/yay-setup.sh new file mode 100644 index 00000000..0197fc86 --- /dev/null +++ b/src/commands/system-setup/arch/yay-setup.sh @@ -0,0 +1,25 @@ +#!/bin/sh -e + +. "$(dirname "$0")/../../common-script.sh" + +installDepend() { + case $PACKAGER in + pacman) + if ! command_exists yay; then + echo "Installing yay as AUR helper..." + sudo "$PACKAGER" --noconfirm -S base-devel + cd /opt && sudo git clone https://aur.archlinux.org/yay-git.git && sudo chown -R "$USER": ./yay-git + cd yay-git && makepkg --noconfirm -si + echo "Yay installed" + else + echo "Aur helper already installed" + fi + ;; + *) + echo "Unsupported package manager: $PACKAGER" + ;; + esac +} + +checkEnv +installDepend \ No newline at end of file diff --git a/src/tabs.rs b/src/tabs.rs index e7ef5d35..fa4ce3dd 100644 --- a/src/tabs.rs +++ b/src/tabs.rs @@ -23,6 +23,19 @@ pub static TABS: LazyLock> = LazyLock::new(|| { name: "root", command: Command::None, } => { + ListNode { + name: "Arch Linux", + command: Command::None, + } => { + ListNode { + name: "Yay AUR Helper", + command: Command::LocalFile("system-setup/arch/yay-setup.sh"), + }, + ListNode { + name: "Paru AUR Helper", + command: Command::LocalFile("system-setup/arch/paru-setup.sh"), + } + }, ListNode { name: "Full System Update", command: Command::LocalFile("system-update.sh"),