From 0c9b72708e02388c35e1524929982412165189c7 Mon Sep 17 00:00:00 2001 From: Jas Singh Date: Thu, 26 Dec 2024 02:10:39 -0800 Subject: [PATCH] Added a built in default update script. (#631) * Added a built in default update script. * Remove exit --- scripts/runUpdates.sh | 56 +++++++++++++++++++++++++++++++++++++++++++ src/options.ts | 2 +- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100755 scripts/runUpdates.sh diff --git a/scripts/runUpdates.sh b/scripts/runUpdates.sh new file mode 100755 index 0000000..2fd65e3 --- /dev/null +++ b/scripts/runUpdates.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +# Provided by: https://github.com/JJDizz1L + +install_arch_updates() { + echo "Updating Arch Linux system..." + sudo pacman -Syu + echo "Updating AUR packages..." + paru -Syu + echo "Updating Flatpak packages..." + flatpak update -y + echo "Done with Arch & AUR updates." +} + +install_ubuntu_updates() { + echo "Updating Ubuntu system..." + sudo apt update && sudo apt upgrade -y + echo "Updating Flatpak packages..." + flatpak update -y + echo "Done with Ubuntu updates." +} + +install_fedora_updates() { + echo "Updating Fedora system..." + sudo dnf update -y + echo "Updating Flatpak packages..." + flatpak update -y + echo "Done with Fedora updates." +} + +install_flatpak_updates() { + echo "Updating Flatpak packages..." + flatpak update -y + echo "Done with FlatPak updates." +} + +case "$1" in +-arch) + install_arch_updates + ;; +-ubuntu) + install_ubuntu_updates + ;; +-fedora) + install_fedora_updates + ;; +-flatpak) + install_flatpak_updates + ;; +*) + echo "Usage: $0 {-arch|-ubuntu|-fedora|-flatpak}" + ;; +esac + +echo "Press any key to exit..." +read -n 1 diff --git a/src/options.ts b/src/options.ts index 4ca7951..c17bbde 100644 --- a/src/options.ts +++ b/src/options.ts @@ -1104,7 +1104,7 @@ const options = mkOptions(CONFIG, { updated: opt('󰏖'), }, pollingInterval: opt(1000 * 60 * 60 * 6), - leftClick: opt(''), + leftClick: opt(`$TERMINAL -e ${SRC_DIR}/scripts/runUpdates.sh -arch`), rightClick: opt(''), middleClick: opt(''), scrollUp: opt(''),