#!/usr/bin/env bash #shellcheck disable=SC2155,SC2034 #shellcheck source=/dev/null # /usr/share/bigbashview/bcc/apps/big-store/index.sh.htm # Description: Big Store installing programs for BigLinux # # Created: 2020/01/11 # Altered: 2024/01/10 # # Copyright (c) 2023-2024, Vilmar Catafesta # 2022-2024, Bruno Gonçalves # 2022-2024, Rafael Ruscher # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. APP="${0##*/}" _VERSION_="1.0.0-20240110" _UPDATED_="10/01/2024" export BOOTLOG="/tmp/bigstore-$USER-$(date +"%d%m%Y").log" export LOGGER='/dev/tty8' export TMP_FOLDER="/tmp/bigstore-$USER" export HOME_FOLDER="$HOME/.bigstore" LIBRARY=${LIBRARY:-'/usr/share/bigbashview/bcc/shell'} [[ -f "${LIBRARY}/bcclib.sh" ]] && source "${LIBRARY}/bcclib.sh" [[ -f "${LIBRARY}/bstrlib.sh" ]] && source "${LIBRARY}/bstrlib.sh" function sh_config { declare -g LOCAL_VERSION="1.0.0-20240110" #Translation export TEXTDOMAINDIR="/usr/share/locale" export TEXTDOMAIN=big-store export ACTION export WINDOW_ID export PACKAGE_NAME declare -g Programas_AUR=$"Programas AUR" declare -g Programas_Flatpak=$"Programas Flatpak" declare -g Programas_Nativos=$"Programas Nativos" declare -g cAudio=$"Audio" declare -g cImagem=$"Imagem" declare -g cVideo=$"Video" declare -g cInternet=$"Internet" declare -g cEscritorio=$"Escritório" declare -g cGraficos=$"Gráficos" declare -g cMultimidia=$"Multimidia" declare -g cJogos=$"Jogos" declare -g cRetroarch=$"Emulador Retroarch" declare -g cEmuladores=$"Emuladores" declare -g cCartas=$"Cartas" declare -g cSistema=$"Sistema" declare -g cXSistema=$"X-Sistema" declare -g cDesenvolvimento=$"Desenvolvimento" declare -g cSobre=$"Sobre" #variáveis públicas export appstream_search_category=0 export aur_search_category=0 export flatpak_search_category=0 export snap_search_category=0 } function APPSTREAM_CATEGORY() { local param_search="$*" if [[ "$appstream_checkbox" = "checked" ]]; then [[ -e "${TMP_FOLDER}/appstream_number.html" ]] && rm -f "${TMP_FOLDER}/appstream_number.html" [[ -e "${TMP_FOLDER}/appstream.html" ]] && rm -f "${TMP_FOLDER}/appstream.html" [[ -e "${TMP_FOLDER}/appstream_build.html" ]] && rm -f "${TMP_FOLDER}/appstream_build.html" cat <<-EOF
$Programas_Nativos
EOF pacman -Qu | awk '{print $1}' >"$TMP_FOLDER/upgradeable.txt" if ((appstream_search_category)); then # python search_category_appstream_pamac.py "${param_search,,}" > "${TMP_FOLDER}/appstream.html" & wait sh_search_category_appstream_pamac "${param_search,,}" & wait appstream_search_category=0 else # python search_appstream_pamac.py "${param_search,,}" > "${TMP_FOLDER}/appstream.html" & wait sh_search_category_appstream_pamac "${param_search,,}" & wait fi if [[ -e "${TMP_FOLDER}/appstream.html" ]]; then cat <<-EOF
EOF else cat <<-EOF
EOF fi fi } export -f APPSTREAM_CATEGORY function AUR_CATEGORY { local param_search="$*" # xdebug "$param_search" # xdebug "$aur_checkbox" if [[ "$aur_checkbox" = "checked" ]]; then [[ -e "${TMP_FOLDER}/aur_number.html" ]] && rm -f "${TMP_FOLDER}/aur_number.html" [[ -e "${TMP_FOLDER}/aur.html" ]] && rm -f "${TMP_FOLDER}/aur.html" [[ -e "${TMP_FOLDER}/aur_build.html" ]] && rm -f "${TMP_FOLDER}/aur_build.html" cat <<-EOF
$Programas_AUR
EOF # xdebug "$aur_search_category" if ((aur_search_category)); then # ./category_aur.sh $(<"$TMP_FOLDER/category_aur.txt") >/dev/null 2>&1 & sh_search_aur_category $(<"$TMP_FOLDER/category_aur.txt") & wait aur_search_category=0 else # resultFilter_checkbox="$resultFilter_checkbox" source search_aur.sh ${param_search,,} >/dev/null 2>&1 & resultFilter_checkbox="$resultFilter_checkbox" sh_search_aur "${param_search,,}" & wait fi if [[ -e "${TMP_FOLDER}/aur.html" ]]; then cat <<-EOF
EOF else cat <<-EOF
EOF fi fi } export -f AUR_CATEGORY function FLATPAK_CATEGORY { local param_search="$*" local i # xdebug "FLATPAK_CATEGORY : $search : all:$@" if [[ "$flatpak_checkbox" = "checked" ]]; then [[ -e "$TMP_FOLDER/flatpak_number.html" ]] && rm -f "$TMP_FOLDER/flatpak_number.html" [[ -e "$TMP_FOLDER/flatpak.html" ]] && rm -f "$TMP_FOLDER/flatpak.html" [[ -e "$TMP_FOLDER/flatpak_build.html" ]] && rm -f "$TMP_FOLDER/flatpak_build.html" cat <<-EOF
$Programas_Flatpak
EOF # xdebug "$param_search" # xdebug "$flatpak_search_category" if (( flatpak_search_category )); then # sh_search_flatpak "${param_search,,}" & wait sh_search_flatpak "${param_search,,}" flatpak_search_category=0 else # resultFilter_checkbox="$resultFilter_checkbox" sh_search_flatpak "${param_search,,}" & wait resultFilter_checkbox="$resultFilter_checkbox" sh_search_flatpak "${param_search,,}" fi if [[ -e "${TMP_FOLDER}/flatpak.html" ]]; then cat <<-EOF
EOF else cat <<-EOF
EOF fi fi } export -f FLATPAK_CATEGORY function SNAP_CATEGORY { local param_search="$*" local i if [[ "$snap_checkbox" = "checked" ]]; then [[ -e "$TMP_FOLDER/snap.html" ]] && rm -f "$TMP_FOLDER/snap.html" [[ -e "$TMP_FOLDER/snap_number.html" ]] && rm -f "$TMP_FOLDER/snap_number.html" [[ -e "$TMP_FOLDER/snap_build.html" ]] && rm -f "$TMP_FOLDER/snap_build.html" cat <<-EOF
$Programas_Snap
EOF if (( snap_search_category )); then sh_search_snap "${param_search,,}" & wait snap_search_category=0 else resultFilter_checkbox="$resultFilter_checkbox" sh_search_snap "${param_search,,}" & wait fi if [[ -e "${TMP_FOLDER}/snap.html" ]]; then cat <<-EOF
EOF else cat <<-EOF
EOF fi fi } export -f SNAP_CATEGORY function ICON_CATEGORY() { local category="$1" local classe="$2" local cname="$3" cat <<-EOF
$cname
EOF } export -f ICON_CATEGORY function list_about() { local array=("$@") echo '

' for item in "${array[@]}"; do echo '
- ' echo $item echo '
' done echo '

' } function ICON_ABOUT() { local array=("$@") cat <<-EOF
$(list_about "${array[@]}")
EOF } export -f ICON_ABOUT #Show category in first page ############################ function sh_main { source header.sh.htm if [[ -z "$category" ]] && [[ "${#search}" -le "2" ]]; then cat <<-EOF

### Big Store

EOF if sh_get_XIVAStudio; then cat <<-EOF
$cXSistema
EOF ICON_CATEGORY storage "fas fa-chart-pie" $"Armazenamento e partições" ICON_CATEGORY javajar "fab fa-java" $"Java JRE" ICON_CATEGORY virtualization "fas fa-laptop-code" $"Virtualização" cat <<-EOF
$cImagem
EOF ICON_CATEGORY vetorial "fas fa-bezier-curve" $"Editores Vetorial" ICON_CATEGORY imageditor "fas fa-paint-brush" $"Editores de imagem, fotografia e desenho" ICON_CATEGORY editortexto "fas fa-paint-brush" $"Editores de texto linha de comando" # ICON_CATEGORY screenshot "fas fa-expand" $"Captura de tela (Screenshot)" ICON_CATEGORY imagemconvert "fas fa-file-image" $"Converter, redimensionar ou compactar imagens" # ICON_CATEGORY image-plugins "fas fa-plug" $"Imagem Plugins" ICON_CATEGORY 3dcad "fas fa-cube" $"Edição 3D e CAD" ICON_CATEGORY fontes "fas fa-font" $"Fontes (Tipografia)" ICON_CATEGORY diagramacao "fas fa-file-invoice" $"Diagramação e organização de páginas" ICON_CATEGORY colorizacao "fas fa-palette" $"Colorização e palheta de cores" cat <<-EOF
$cVideo
EOF ICON_CATEGORY videoeditors "fas fa-photo-video" $"Editores de video" ICON_CATEGORY videoplay "fas fa-film" $"Reprodutores de vídeo" ICON_CATEGORY 2deditor "fas fa-film" $"Animação e 2D" ICON_CATEGORY captura "fas fa-video" $"Captura de tela e video download" ICON_CATEGORY videotream "fas fa-tv" $"Stream/transmissão online" ICON_CATEGORY dvdvideoconverter "fas fa-compact-disc" $"Conversores de vídeo e gravadores CD/DVD" cat <<-EOF
$cAudio
EOF ICON_CATEGORY audioplayer "fas fa-headphones" $"Reprodutores de áudio" ICON_CATEGORY radio "fas fa-broadcast-tower" $"Rádio online" ICON_CATEGORY audioconvert "fas fa-microphone" $"Gravadores e conversores de áudio" ICON_CATEGORY audioeditor "fas fa-music" $"Editores de áudio (DAW)" ICON_CATEGORY audio-plugins "fas fa-plug" $"Audio Plugins" cat <<-EOF
EOF fi ## Big category ## #echo '' cat <<-EOF
$cInternet
EOF ICON_CATEGORY browser "fas fa-globe" $"Navegadores" ICON_CATEGORY mail "fas fa-envelope" $"E-mail" ICON_CATEGORY cloud "fas fa-cloud-upload-alt" $"Armazenamento nas nuvens" ICON_CATEGORY download "fas fa-file-download" $"Download" ICON_CATEGORY torrent "fas fa-magnet" $"Compartilhadores e Torrent" ICON_CATEGORY messages "fas fa-comments" $"Mensageiros e Conferências" ICON_CATEGORY remote "fas fa-laptop-house" $"Acesso Remoto, FTP, SSH, VNC, RDP..." ICON_CATEGORY network "fas fa-network-wired" $"Ferramentas de rede" ICON_CATEGORY news "fas fa-newspaper" $"Notícias, Feeds e RSS" cat <<-EOF
$cEscritorio
EOF ICON_CATEGORY office "fas fa-briefcase" $"Suíte Office" ICON_CATEGORY book "fas fa-book" $"Visualizadores de PDF, Epub, e-books e mais" ICON_CATEGORY pdf "fas fa-file-pdf" $"Editores de PDF" ICON_CATEGORY calendar "fas fa-calendar-alt" $"Agenda de tarefas e contatos" # ICON_CATEGORY calc "fas fa-calculator" $"Cálculos" # ICON_CATEGORY other "fas fa-random" $"Outros" cat <<-EOF
$cGraficos
EOF ICON_CATEGORY imageplayer "fas fa-image" $"Visualizadores de imagem" ICON_CATEGORY imageeditor "fas fa-paint-brush" $"Editores de imagem e ferramentas de desenho" ICON_CATEGORY screenshot "fas fa-expand" $"Captura de tela (Screenshot)" ICON_CATEGORY imageconvert "fas fa-file-image" $"Converter, redimensionar ou compactar imagens" ICON_CATEGORY 3d "fas fa-cube" $"Edição 3D e CAD" cat <<-EOF
$cMultimidia
EOF ICON_CATEGORY audioplayer "fas fa-headphones" $"Reprodutores de áudio" ICON_CATEGORY radio "fas fa-broadcast-tower" $"Rádio online" ICON_CATEGORY audioconvert "fas fa-microphone" $"Gravadores e conversores de áudio" ICON_CATEGORY audioeditor "fas fa-music" $"Editores de áudio" ICON_CATEGORY videoplayer "fas fa-film" $"Reprodutores de vídeo" ICON_CATEGORY videostream "fas fa-tv" $"Vídeo online, IPTV, Youtube..." ICON_CATEGORY videoeditor "fas fa-photo-video" $"Editores e compactadores de vídeo" ICON_CATEGORY dvd "fas fa-compact-disc" $"Gravadores e copiadores de CD e DVD" ICON_CATEGORY webcam "fas fa-video" $"Webcam, gravação de tela e transmissão de vídeo" cat <<-EOF
$cJogos
EOF ICON_CATEGORY gamemanager "fas fa-gamepad" $"Gerenciadores de jogos" ICON_CATEGORY gameutility "fas fa-toolbox" $"Utilitários para jogos" #ICON_CATEGORY gameretroarch "fas fa-cog" $"Emulador Retroarch" cat <<-EOF
$cRetroarch
EOF #ICON_CATEGORY gameemulator "fas fa-cogs" $"Emuladores" cat <<-EOF
$cEmuladores
EOF ICON_CATEGORY devgames "fas fa-code" $"Criadores de jogos" ICON_CATEGORY gamearcade "fas fa-rocket" $"Ação/Arcade" #ICON_CATEGORY gamecard "fas fa-crown" $"Cartas" cat <<-EOF
$cCartas
EOF ICON_CATEGORY gameeducational "fas fa-graduation-cap" $"Educacional" ICON_CATEGORY gamestrategy "fas fa-user-secret" $"Estratégia" ICON_CATEGORY gamepuzzle "fas fa-puzzle-piece" $"Puzzles" ICON_CATEGORY gameboard "fas fa-chess-board" $"Tabuleiro" ICON_CATEGORY gamerpg "fas fa-dice-d20" $"RPG" ICON_CATEGORY gameother "fas fa-dice" $"Outros" cat <<-EOF
$cSistema
EOF ICON_CATEGORY storage "fas fa-chart-pie" $"Armazenamento e partições" ICON_CATEGORY fonts "fas fa-font" $"Fontes (Tipografia)" ICON_CATEGORY javajar "fab fa-java" $"Java JRE" ICON_CATEGORY virtualization "fas fa-laptop-code" $"Virtualização" cat <<-EOF
$cDesenvolvimento
EOF ICON_CATEGORY deveditor "fas fa-file-code" $"Editores de código e IDE" ICON_CATEGORY devbd "fas fa-database" $"Banco de dados" ICON_CATEGORY devwebserver "fas fa-server" $"Servidores WEB" #sex 05 jan 2024 12:19:03 -04 cat <<-EOF
$cSobre
EOF my_array=("Aplicativo : $TEXTDOMAIN" "Versão : $LOCAL_VERSION" "Atualizado em : $_UPDATED_") ICON_ABOUT "${my_array[@]}" my_array=('Desenvolvedores:' '' 'Bruno Gonçalves, [www.biglinux.com.br]' 'Vilmar Catafesta, [vcatafesta@gmail.com]' 'Rafael Ruscher, [rruscher@gmail.com]') ICON_ABOUT "${my_array[@]}" #sex 05 jan 2024 12:19:03 -04 cat <<-EOF
EOF fi source biglinux-category if sh_get_XIVAStudio; then source xiva-category cat <<-EOF
EOF else cat <<-EOF
EOF fi } #sh_debug sh_config sh_main