From 84c0183f8e92730c6d5641fd9a557ea37b12b7db Mon Sep 17 00:00:00 2001 From: napcok Date: Thu, 29 Dec 2016 15:07:58 +0100 Subject: [PATCH] mabox-software-pipemenu --- usr/bin/mabox-software-pipemenu | 113 ++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100755 usr/bin/mabox-software-pipemenu diff --git a/usr/bin/mabox-software-pipemenu b/usr/bin/mabox-software-pipemenu new file mode 100755 index 0000000..22249c4 --- /dev/null +++ b/usr/bin/mabox-software-pipemenu @@ -0,0 +1,113 @@ +#!/bin/bash +# mabox-software-pipemenu - an Openbox pipemenu to manage software updates, install popular applications, etc. + +MB_COMMON_LIBDIR="/usr/lib/mabox/mabox-common" + + +if ! . "$MB_COMMON_LIBDIR/mabox-include.cfg" 2> /dev/null; then + echo $"Error: Failed to locate mabox-include.cfg in $MB_COMMON_LIBDIR" >&2 + exit 1 +fi + +case $LANG in + pl*) + SYSUPDATE="Aktualizacja systemu" + MIRR_RANK="Ranking mirrorów" + MIRROR_RANK="Tworzenie rankingu mirrorów" + RENEWKEYS="Odnawianie kluczy" + ALL="Wszystkie" + GEOIP="Najbliższe (wg geoip)" + SOFT_MANAGEMENT="Zarządzanie oprogramowaniem" + POPULAR_APPS="Popularne programy" + INSTALL="Instaluj" + INSTALLING="Instalowanie" + LAUNCH="Uruchom" + GRAPHICS="Grafika" + GAMES="Gry" + REG_MENU="Regeneruj Menu" + ;; + *) + SYSUPDATE="System update" + MIRR_RANK="Rank mirrors" + MIRROR_RANK="Create mirror rank" + ALL="All" + GEOIP="by geoip" + RENEWKEYS="Renew keys" + SOFT_MANAGEMENT="Software Management" + POPULAR_APPS="Applications" + INSTALL="Install" + INSTALLING="Installing" + LAUNCH="Launch" + GRAPHICS="Graphics" + GAMES="Gry" + REG_MENU="Regenerate Menu" + ;; +esac + + +if [[ $1 = '--update' ]]; then + terminator --title="$SYSUPDATE" --command='sudo pacman -Syu' + +elif [[ $1 = '--rank-all' ]]; then + terminator --title="$MIRROR_RANK" --command='sudo pacman-mirrors -i -c all' +elif [[ $1 = '--rank-geoip' ]]; then + terminator --title="$MIRROR_RANK" --command='sudo pacman-mirrors -i --geoip' +elif [[ $1 = '--fixkeys' ]]; then + terminator --title="$RENEWKEYS" --command='sudo pacman -Sy archlinux-keyring manjaro-keyring mabox-keyring' +else +menuStart +menuSeparator "$SOFT_MANAGEMENT" +menuItem "$SYSUPDATE" "mabox-software-pipemenu --update" +menuSubmenu 'rank' "$MIRR_RANK" +menuItem "$ALL" "mabox-software-pipemenu --rank-all" +menuItem "$GEOIP" "mabox-software-pipemenu --rank-geoip" +menuSubmenuEnd +menuItem "$RENEWKEYS" "mabox-software-pipemenu --fixkeys" +menuSeparator "$POPULAR_APPS" +menuSubmenu 'internet' 'Internet' +internet=('chromium' 'firefox' 'opera' 'thunderbird' 'dropbox') +for curApp in "${internet[@]}"; do + if ! type "$curApp" &> /dev/null; then + menuItem "$INSTALL ${curApp^}" "terminator --title='$INSTALLING ${curApp^}' --command='sudo pacman -S $curApp'" + else + menuItem "$LAUNCH ${curApp^}" "$curApp" + fi +done +menuSubmenuEnd + +menuSubmenu 'multimedia' 'Multimedia' +multimedia=('kodi' 'audacious' 'vlc' 'smplayer' 'simplescreenrecorder') +for curApp in "${multimedia[@]}"; do + if ! type "$curApp" &> /dev/null; then + menuItem "$INSTALL ${curApp^}" "terminator --title='$INSTALLING ${curApp^}' --command='sudo pacman -S $curApp'" + else + menuItem "$LAUNCH ${curApp^}" "$curApp" + fi +done +menuSubmenuEnd + +menuSubmenu 'grafika' "$GRAPHICS" +grafika=('gimp' 'inkscape' 'blender') +for curApp in "${grafika[@]}"; do + if ! type "$curApp" &> /dev/null; then + menuItem "$INSTALL ${curApp^}" "terminator --title='$INSTALLING ${curApp^}' --command='sudo pacman -S $curApp'" + else + menuItem "$LAUNCH ${curApp^}" "$curApp" + fi +done +menuSubmenuEnd +menuSubmenu 'gry' "$GAMES" +gry=('playonlinux' 'steam-manjaro' 'wesnoth') +for curApp in "${gry[@]}"; do + if ! type "$curApp" &> /dev/null; then + menuItem "$INSTALL ${curApp^}" "terminator --title='$INSTALLING ${curApp^}' --command='sudo pacman -S $curApp'" + else + menuItem "$LAUNCH ${curApp^}" "$curApp" + fi +done +menuSubmenuEnd +menuSeparator +menuItem "$REG_MENU" "mb-regenerate-menu" +menuEnd +fi +exit 0