From f9c93138bc41b40dc7b95d2b2d649331e63377da Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Thu, 19 Sep 2024 19:04:05 +0200 Subject: [PATCH] AUR Installation --- tabs/applications-setup/linutil-installer.sh | 44 ++++++++++++++++++++ tabs/applications-setup/linutil-updater.sh | 5 +++ tabs/applications-setup/tab_data.toml | 20 +++++++++ 3 files changed, 69 insertions(+) create mode 100755 tabs/applications-setup/linutil-installer.sh create mode 100755 tabs/applications-setup/linutil-updater.sh diff --git a/tabs/applications-setup/linutil-installer.sh b/tabs/applications-setup/linutil-installer.sh new file mode 100755 index 000000000..733a4ca66 --- /dev/null +++ b/tabs/applications-setup/linutil-installer.sh @@ -0,0 +1,44 @@ +#!/bin/sh -e + +. ../common-script.sh + +installLinutil() { + printf "%b\n" "${YELLOW}Installing Linutil...${RC}" + case "$PACKAGER" in + pacman) + printf "%b\n" "----------------------------" + printf "%b\n" "Select the package to install:" + printf "%b\n" "1. ${CYAN}linutil${RC} (stable release compiled from source)" + printf "%b\n" "2. ${CYAN}linutil-bin${RC} (stable release pre-compiled)" + printf "%b\n" "3. ${CYAN}linutil-git${RC} (compiled from the latest commit)" + printf "%b\n" "----------------------------" + printf "%b\n" "Enter your choice: " + read -r choice + case $choice in + 1) "$AUR_HELPER" -S --noconfirm linutil ;; + 2) "$AUR_HELPER" -S --noconfirm linutil-bin ;; + 3) "$AUR_HELPER" -S --noconfirm linutil-git ;; + *) + printf "%b\n" "${RED}Invalid choice:${RC} $choice" + exit 1 + ;; + esac + printf "%b\n" "${GREEN}Installed successfully.${RC}" + ;; + *) + printf "%b\n" "${RED}There are no official packages for your distro.${RC}" + printf "%b" "${YELLOW}Do you want to install the crates.io package? (y/N) ${RC}" + read -r choice + case $choice in + y|Y) + printf "%b\n" "Work In Progress." + ;; + *) printf "%b\n" "${RED}Linutil not installed.${RC}" ;; + esac + esac +} + +checkEnv +checkEscalationTool +checkAURHelper +installLinutil diff --git a/tabs/applications-setup/linutil-updater.sh b/tabs/applications-setup/linutil-updater.sh new file mode 100755 index 000000000..82ab60c51 --- /dev/null +++ b/tabs/applications-setup/linutil-updater.sh @@ -0,0 +1,5 @@ +#!/bin/sh -e + +. ../common-script.sh + +# WIP: crates have to be updated manually diff --git a/tabs/applications-setup/tab_data.toml b/tabs/applications-setup/tab_data.toml index 750239c99..c5cc26bc1 100644 --- a/tabs/applications-setup/tab_data.toml +++ b/tabs/applications-setup/tab_data.toml @@ -43,3 +43,23 @@ script = "setup-flatpak.sh" name = "ZSH Prompt" description = "The Z shell is a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh.\nThis command installs ZSH prompt and provides basic configuration." script = "zsh-setup.sh" + +[[data]] +name = "Install Linutil" +description = "Installs a distro-specific Linutil package locally." +script = "linutil-installer.sh" + +[[data.preconditions]] +matches = false +data = "command_exists" +values = [ "linutil" ] + +[[data]] +name = "Update Linutil" +description = "Updates your local Linutil installation." +script = "linutil-updater.sh" + +[[data.preconditions]] +matches = true +data = "command_exists" +values = [ "linutil" ]