From f0b7c010bcee47a16303474b3cd333a5859ff798 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Thu, 22 Feb 2024 11:14:10 +0100 Subject: [PATCH] mb-cli wrapper added --- bin/mb-cli | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100755 bin/mb-cli diff --git a/bin/mb-cli b/bin/mb-cli new file mode 100755 index 0000000..7404064 --- /dev/null +++ b/bin/mb-cli @@ -0,0 +1,67 @@ +#!/bin/bash + +# mb-cli run some commands from launchers in terminal + +case "$LANG" in + pl*) + _NOT_FOUND_TERMINATOR="Terminator nie został znaleziony!" + _DESC="Zainstaluj Terminatora, aby wykonać skrypt" + _INSTALL_TERMINATOR="Zainstaluj Terminatora" + ;; + *) + _NOT_FOUND_TERMINATOR="Terminator not found!" + _DESC="To run script install Terminator first" + _INSTALL_TERMINATOR="Install Terminator" + ;; +esac + +if ! hash terminator &> /dev/null +then + notify-send.sh -i error "$_NOT_FOUND_TERMINATOR" "$_DESC" -o "$_INSTALL_TERMINATOR:pamac-installer terminator" + exit 1 +fi + + +case "$LANG" in + pl*) + _UPDATE="Aktualizacja systemu" + _STATS="Statystyki pakietów" + _MIRRORS="Ranking mirrorów" + _BTOP="Btop - monitor zasobów" + _FINISHED="Zakończono! Wciśnij ENTER aby zamknąć terminal" + ;; + *) + _UPDATE="System update" + _STATS="Package statistics" + _MIRRORS="Morror ranking" + _BTOP="Btop - a monitor of resources" + _FINISHED=" FINISHED! Hit ENTER or close this window" + ;; +esac + +case "$1" in + update) + CMD="yay -Syyu" + terminator -T "$_UPDATE: ($CMD)" -e "${CMD};read -p \"${_FINISHED}\"" + ;; + stats) + CMD="yay -Ps" + terminator -T "$_STATS: ($CMD)" -e "${CMD};read" + ;; + mirrors) + CMD="sudo pacman-mirrors -f5" + terminator -T "$_MIRRORS: ($CMD)" -e "${CMD};read -p \"${_FINISHED}\"" + ;; + mirrors_all) + CMD="sudo pacman-mirrors -i -c all" + terminator -T "$_MIRRORS: ($CMD)" -e "${CMD};read -p \"${_FINISHED}\"" + ;; + mirrors_geo) + CMD="sudo pacman-mirrors -i --geoip" + terminator -T "$_MIRRORS: ($CMD)" -e "${CMD};read -p \"${_FINISHED}\"" + ;; + btop) + terminator -T "$_BTOP" -e "btop" + ;; + *):;; +esac