mabox-pipemenus/usr/bin/mabox-software-pipemenu

134 lines
3.9 KiB
Plaintext
Raw Permalink Normal View History

2016-12-29 15:07:58 +01:00
#!/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"
2017-01-02 21:39:45 +01:00
OFFICE="Biuro"
2016-12-29 15:07:58 +01:00
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"
2017-01-02 21:39:45 +01:00
GAMES="Games"
OFFICE="Office"
2016-12-29 15:07:58 +01:00
REG_MENU="Regenerate Menu"
;;
esac
if [[ $1 = '--update' ]]; then
2018-12-05 22:58:50 +01:00
pamac-manager --updates
2016-12-29 15:07:58 +01:00
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'
2018-12-20 12:54:47 +01:00
internet=('chromium' 'palemoon-bin' 'opera' 'thunderbird')
2016-12-29 15:07:58 +01:00
for curApp in "${internet[@]}"; do
if ! type "$curApp" &> /dev/null; then
2018-12-05 22:10:09 +01:00
menuItem "$INSTALL ${curApp^}" "pamac-installer $curApp"
2016-12-29 15:07:58 +01:00
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
2018-12-05 22:10:09 +01:00
menuItem "$INSTALL ${curApp^}" "pamac-installer $curApp"
2016-12-29 15:07:58 +01:00
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
2018-12-05 22:10:09 +01:00
menuItem "$INSTALL ${curApp^}" "pamac-installer $curApp"
2016-12-29 15:07:58 +01:00
else
menuItem "$LAUNCH ${curApp^}" "$curApp"
fi
done
menuSubmenuEnd
menuSubmenu 'gry' "$GAMES"
2020-01-17 11:18:34 +01:00
gry=('playonlinux' 'steam-manjaro' 'lutris' 'wesnoth')
2016-12-29 15:07:58 +01:00
for curApp in "${gry[@]}"; do
if ! type "$curApp" &> /dev/null; then
2018-12-05 22:10:09 +01:00
menuItem "$INSTALL ${curApp^}" "pamac-installer $curApp"
2016-12-29 15:07:58 +01:00
else
menuItem "$LAUNCH ${curApp^}" "$curApp"
fi
done
menuSubmenuEnd
2017-01-02 21:39:45 +01:00
menuSubmenu 'system' "System"
system=('manjaro-printer' 'bleachbit' 'virtualbox')
for curApp in "${system[@]}"; do
if ! type "$curApp" &> /dev/null; then
2018-12-05 22:10:09 +01:00
menuItem "$INSTALL ${curApp^}" "pamac-installer $curApp"
2017-01-02 21:39:45 +01:00
else
menuItem "$LAUNCH ${curApp^}" "$curApp"
fi
done
menuSubmenuEnd
menuSubmenu 'office' "$OFFICE"
2017-01-02 21:42:20 +01:00
system=('abiword' 'gnumeric' 'libreoffice-still' 'libreoffice-fresh' 'cherrytree' 'zim')
2017-01-02 21:39:45 +01:00
for curApp in "${system[@]}"; do
if ! type "$curApp" &> /dev/null; then
2018-12-05 22:10:09 +01:00
menuItem "$INSTALL ${curApp^}" "pamac-installer $curApp"
2017-01-02 21:39:45 +01:00
else
menuItem "$LAUNCH ${curApp^}" "$curApp"
fi
done
menuSubmenuEnd
2016-12-29 15:07:58 +01:00
menuEnd
fi
exit 0