#!/usr/bin/env bash
#shellcheck disable=SC2155,SC2034
#shellcheck source=/dev/null

#  /usr/share/bigbashview/bcc/apps/big-store/xiva-category
#  Description: Big Store installing programs for BigLinux
#
#  Created: 2020/01/11
#  Altered: 2023/09/25
#
#  Copyright (c) 2023-2023, Vilmar Catafesta <vcatafesta@gmail.com>
#                2022-2023, Bruno Gonçalves <www.biglinux.com.br>
#                2022-2023, Rafael Ruscher <rruscher@gmail.com>
#  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-20230925"
export BOOTLOG="/tmp/bigstore-$USER-$(date +"%d%m%Y").log"
export LOGGER='/dev/tty8'
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() {
	#Translation
	export TEXTDOMAINDIR="/usr/share/locale"
	export TEXTDOMAIN=big-store
	declare -g lcode=$(sh_get_code_lang)
	declare -g Programas_AUR=$"Programas AUR"
	declare -g Programas_Flatpak=$"Programas Flatpak"
	declare -g Programas_Nativos=$"Programas Nativos"
	declare -gA xiva_appstream_CATEGORIES
	declare -gA xiva_flatpak_CATEGORIES

	# Dados para a categoria "vetorial"
	xiva_appstream_CATEGORIES["vetorial"]="gravit-designer gravit-designer-bin gravit-designer-electron inkscape kxstitch sk1"
	xiva_flatpak_CATEGORIES["vetorial"]="org.inkscape.Inkscape io.designer.GravitDesigner org.kde.kxstitch"

	# Dados para a categoria "imageditor"
	xiva_appstream_CATEGORIES["imageditor"]="darktable gimp hugin LightZone luminancehdr krita rawtherapee digikam mypaint"
	xiva_flatpak_CATEGORIES["imageditor"]="org.darktable.Darktable org.gimp.GIMP net.sourceforge.Hugin net.sourceforge.qtpfsgui.LuminanceHDR com.rawtherapee.RawTherapee org.kde.digikam"

	# Dados para a categoria "editortexto"
	xiva_appstream_CATEGORIES["editortexto"]="nano vim neovim emacs ed joe mcedit eddie micro edlin edtext "
	xiva_flatpak_CATEGORIES["editortexto"]="com.agateau.nanonote org.vim.Vim io.neovim.nvim"

	# Dados para a categoria "imagemconvert"
	xiva_appstream_CATEGORIES["imagemconvert"]="converseen ciano xnconvert rgb2cmyk"
	# xiva_flatpak_CATEGORIES["imagemconvert"]="Adicione aqui se necessário"

	# Dados para a categoria "3dcad"
	xiva_appstream_CATEGORIES["3dcad"]="blender wings3d sweethome3d freecad openscad cura librecad qcad godot gb-studio-bin meshroom-bin unity-editor unreal-engine makehuman-git brlcad Kxstitch"
	xiva_flatpak_CATEGORIES["3dcad"]="org.blender.Blender com.wings3d.WINGS com.sweethome3d.Sweethome3d org.freecadweb.FreeCAD org.openscad.OpenSCAD org.kde.kxstitch"

	# Dados para a categoria "fontes"
	xiva_appstream_CATEGORIES["fontes"]="birdfont font-manager ttf-bitstream-vera ttf-caladea ttf-carlito ttf-dejavu ttf-anonymous-pro ttf-fira-code ttf-fira-mono ttf-fira-sans ttf-font-icons \
	ttf-ibm-plex ttf-lato ttf-linux-libertine ttf-montserrat ttf-opensans ttf-roboto ttf-roboto-mono ttf-ms-fonts ttf-mac-fonts ttf-ms-win10-auto ttf-wps-fonts \
	ttf-cascadia-code ttf-comfortaa ttf-cormorant ttf-croscore ttf-dejavu ttf-dejavu-nerd ttf-fira-code ttf-fira-mono ttf-fira-sans ttf-firacode-nerd ttf-font-icons\
	ttf-hack ttf-ibm-plex ttf-inconsolata ttf-inconsolata-go-nerd ttf-inconsolata-lgc-nerd ttf-inconsolata-nerd ttf-input ttf-jetbrains-mono ttf-jetbrains-mono-nerd\
	ttf-lato ttf-liberation ttf-linux-libertine ttf-meslo-nerd-font-powerlevel10k ttf-monoid ttf-ms-fonts ttf-nerd-fonts-symbols-1000-em ttf-nerd-fonts-symbols-2048-em\
	ttf-nerd-fonts-symbols-2048-em-mono ttf-nerd-fonts-symbols ttf-nerd-fonts-symbols-common ttf-nerd-fonts-symbols-mono ttf-proggy-clean ttf-proggyclean-nerd ttf-roboto\
	ttf-roboto-mono ttf-sourcecodepro-nerd ttf-space-mono-nerd ttf-tahoma ttf-terminus-nerd ttf-tibetan-machine ttf-ubuntu-font-family ttf-ubuntu-nerd\
	sdl2_ttf sdl_ttf ttf-anonymous-pro ttf-bitstream-vera ttf-caladea"

	# Dados para a categoria "diagramacao"
	xiva_appstream_CATEGORIES["diagramacao"]="glabels scribus"
	xiva_flatpak_CATEGORIES["diagramacao"]="org.gnome.glabels-3 net.scribus.Scribus"

	# Dados para a categoria "colorizacao"
	xiva_appstream_CATEGORIES["colorizacao"]="kcolorchooser displaycal"

	# Dados para a categoria "videoeditors"
	xiva_appstream_CATEGORIES["videoeditors"]="kdenlive shotcut pitivi openshot vidcutter flowblade avidemux-qt blender losslesscut-bin davinci-resolve davinci-resolve-studio lightworks lives cinelerra-gg aegisub natron"
	xiva_flatpak_CATEGORIES["videoeditors"]="org.kde.kdenlive org.shotcut.Shotcut org.pitivi.Pitivi org.openshot.OpenShot com.ozmartians.VidCutter io.github.jliljebl.Flowblad org.avidemux.Avidemux org.blender.Blender no.mifi.losslesscut fr.natron.Natron"

	# Dados para a categoria "videoplay"
	xiva_appstream_CATEGORIES["videoplay"]="smplayer vlc mpv totem celluloid parole kodi webtorrent-desktop-bin freetube-bin stremio"
	xiva_flatpak_CATEGORIES["videoplay"]="io.webtorrent.WebTorrent info.smplayer.SMPlayer org.videolan.VLC io.mpv.Mpv org.gnome.Totem io.github.celluloid_player.Celluloid org.gnome.Parole tv.kodi.Kodi io.freetubeapp.FreeTube com.stremio.Stremio"

	# Dados para a categoria "2deditor"
	xiva_appstream_CATEGORIES["2deditor"]="synfig opentoonz tupitube natron"
	xiva_flatpak_CATEGORIES["2deditor"]="org.synfig.SynfigStudio io.github.OpenToonz fr.natron.Natron"

	# Dados para a categoria "captura"
	xiva_appstream_CATEGORIES["captura"]="peek kazam simplescreenrecorder youtubedl-gui jdownloader2 obs-studio minitube clipgrab"
	xiva_flatpak_CATEGORIES["captura"]="com.uploadedlobster.peek"

	# Dados para a categoria "videotream"
	xiva_appstream_CATEGORIES["videotream"]="hypnotix plex-media-server plex-media-player obs-studio stremio"
	xiva_flatpak_CATEGORIES["videotream"]="com.stremio.Stremio"

	# Dados para a categoria "dvdvideoconverter"
	xiva_appstream_CATEGORIES["dvdvideoconverter"]="handbrake ciano mystiq k3b brasero dvdstyler devede xfburn acetoneiso2"
	xiva_flatpak_CATEGORIES["dvdvideoconverter"]="fr.handbrake.ghb com.github.robertsanseries.ciano"

	# Dados para a categoria "audio-plugins"
	xiva_appstream_CATEGORIES["audio-plugins"]="a2jmidid adljack adlplug-lv2 adlplug-standalone adlplug-vst aeolus aether.lv2 agordejo aj-snapshot aliki ambdec ambix-lv2
	ambix-standalone ambix-vst amb-plugins ams ams-lv2 amsynth artyfx aubio avldrums.lv2 bchoppr beatslash-lv2 bespokesynth blop blop.lv2 bsequencer bshapr bslizr calf caps
	cardinal-clap cardinal-jack cardinal-lv2 cardinal-vst cardinal-vst3 carla chuck cmt csound csound-plugins csoundqt deteriorate-lv2 dexed dgedit din distrho-ports-lv2
	distrho-ports-vst distrho-ports-vst3 dpf-plugins-clap dpf-plugins-dssi dpf-plugins-ladspa dpf-plugins-lv2 dpf-plugins-vst dpf-plugins-vst3 dragonfly-reverb-clap
	dragonfly-reverb-lv2 dragonfly-reverb-vst dragonfly-reverb-vst3 drumgizmo-lv2 drumgizmo-standalone drumkv1-lv2 drumkv1-standalone ebumeter ecasound eq10q eteroj.lv2 fabla faust
	fil-plugins fluajho fluidsynth fomp.lv2 foxdot g2reverb geonkick-lv2 geonkick-standalone gigedit gmsynth.lv2 guitarix haskell-tidal helm-synth-lv2 helm-synth-standalone
	helm-synth-vst hexter hydrogen iempluginsuite infamousplugins ir.lv2 jaaa jalv japa jconvolver jnoisemeter jsampler kmidimon laborejo lilypond linuxsampler liquidsfz
	lsp-plugins-standalone lv2-example-plugins lv2file marsyas mcp-plugins mda.lv2 mellite mephisto.lv2 meterbridge midi_matrix.lv2 midimsg-lv2 moony.lv2 ninjas2-lv2 ninjas2-standalone
	ninjas2-vst njconnect noise-repellent non-mixer non-sequencer non-timeline ob-xd odin2-synthesizer opl-synth opnplug-lv2 opnplug-standalone opnplug-vst osc2midi osmid padthv1-lv2
	padthv1-standalone patroneo polyphone pvoc qmidiarp qmidictl qmidinet qsynth qxgedit rakarrack-plus rev-plugins rubberband-ladspa rubberband-lv2 rubberband-vamp samplv1-lv2
	samplv1-standalone sc3-plugins setbfree-lv2 setbfree-standalone sfizz sherlock.lv2 solfege sonic-visualiser sorcer sound-gambit spectmorph-lv2 spectmorph-tools spectmorph-vst ssr
	surge surge-xt swh-plugins synthv1-lv2 synthv1-standalone tap-plugins tembro timidity++ vamp-aubio-plugins vamp-plugin-sdk vco-plugins vico vm.lv2 vmpk wah-plugins wolf-shaper-dssi
	wolf-shaper-lv2 wolf-shaper-vst wolf-shaper-vst3 wolf-spectrum x42-plugins-lv2 x42-plugins-standalone xmonk.lv2 yabridge yass yoshimi zam-plugins-clap zam-plugins-ladspa
	zam-plugins-lv2 zam-plugins-vst zam-plugins-vst3 zita-ajbridge zita-at1 zita-bls1 zita-dc1 zita-dpl1 zita-lrx zita-mu1 zita-njbridge zita-rev1 zynaddsubfx"
	# xiva_flatpak_CATEGORIES["audio-plugins"]="Adicione aqui se necessário"

	# Dados para a categoria "browser"
	xiva_appstream_CATEGORIES["browser"]="firefox firefox-i18n-$lcode brave-browser opera vivaldi chromium falkon palemoon-bin epiphany google-chrome microsoft-edge-stable-bin"
	# xiva_flatpak_CATEGORIES["browser"]="Adicione aqui se necessário"

	# Dados para a categoria "mail"
	xiva_appstream_CATEGORIES["mail"]="thunderbird thunderbird-i18n-$lcode evolution geary kmail kube balsa claws-mail sylpheed trojita mailspring"
	# xiva_flatpak_CATEGORIES["mail"]="Adicione aqui se necessário"

	# Dados para a categoria "download"
	xiva_appstream_CATEGORIES["download"]="kget gwget uget steadyflow jdownloader2 clipgrab youtubedl-gui xdman flareget"
	# xiva_flatpak_CATEGORIES["download"]="Adicione aqui se necessário"

	# Dados para a categoria "torrent"
	xiva_appstream_CATEGORIES["torrent"]="qbittorrent torrential deluge-gtk ktorrent fragments transmission-qt amule tixati frostwire"
	# xiva_flatpak_CATEGORIES["torrent"]="Adicione aqui se necessário"

	# Dados para a categoria "messages"
	xiva_appstream_CATEGORIES["messages"]="telegram-desktop discord teamspeak3 mumble signal-desktop element-desktop caprine gajim murmur mattermost jami-gnome pidgin polari
	hexchat	wire-desktop quassel-client zoom skypeforlinux-stable-bin slack-desktop teams viber icq-bin"
	# xiva_flatpak_CATEGORIES["messages"]="Adicione aqui se necessário"

	# Dados para a categoria "remote"
	xiva_appstream_CATEGORIES["remote"]="remmina vinagre tigervnc krdc krfb filezilla putty tmate rustdesk-bin anydesk-bin teamviewer chrome-remote-desktop"
	# xiva_flatpak_CATEGORIES["remote"]="Adicione aqui se necessário"

	# Dados para a categoria "cloud"
	xiva_appstream_CATEGORIES["cloud"]="nextcloud-client owncloud-client syncthing-gtk sparkleshare rclone cozy-desktop dropbox megasync overgrive cloudcross seafile-client"
	# xiva_flatpak_CATEGORIES["cloud"]="Adicione aqui se necessário"

	# Dados para a categoria "network"
	xiva_appstream_CATEGORIES["network"]="wireshark-qt ipscan gnome-nettool mtr-gtk"
	# xiva_flatpak_CATEGORIES["network"]="Adicione aqui se necessário"

	# Dados para a categoria "news"
	xiva_appstream_CATEGORIES["news"]="newsflash akregator gfeeds pan liferea rssguard quiterss"
	# xiva_flatpak_CATEGORIES["news"]="Adicione aqui se necessário"

	# Dados para a categoria "book"
	xiva_appstream_CATEGORIES["book"]="okular foliate evince atril gnome-books bookworm fbreader coolreader calibre peruse"
	# xiva_flatpak_CATEGORIES["book"]="Adicione aqui se necessário"

	# Dados para a categoria "pdf"
	xiva_appstream_CATEGORIES["pdf"]="pdfarranger diffpdf pdfmod pdftricks pdfmixtool pdfslicer gscan2pdf mupdf masterpdfeditor masterpdfeditor-free"
	# xiva_flatpak_CATEGORIES["pdf"]="Adicione aqui se necessário"

	# Dados para a categoria "office"
	xiva_appstream_CATEGORIES["office"]="libreoffice-fresh-$lcode libreoffice-still-$lcode freeoffice onlyoffice-desktopeditors softmaker-office-2021
	softmaker-office-2018 calligra wps-office wps-office-mui-$lcode"
	# xiva_flatpak_CATEGORIES["office"]="Adicione aqui se necessário"

	# Dados para a categoria "calendar"
	xiva_appstream_CATEGORIES["calendar"]="osmo kalarm gnome-calendar pantheon-calendar gnome-contacts kontact korganizer kaddressbook evolution evolution-ews minetime-bin"
	# xiva_flatpak_CATEGORIES["calendar"]="Adicione aqui se necessário"

	# Dados para a categoria "deveditor"
	xiva_appstream_CATEGORIES["deveditor"]="atom code brackets-bin netbeans geany bluefish arduino rider gambas3-ide gnome-builder pycharm-community-edition
	intellij-idea-community-edition codeblocks kdevelop kdevelop-python kdevelop-php android-studio eclipse-java-bin goland visual-studio-code-bin sublime-text-3 sublime-text-4-dev
	okteta phpstorm webstorm cudatext-gtk2-bin cudatext-qt5-bin vscodium-bin"
	xiva_flatpak_CATEGORIES["deveditor"]="org.codeblocks.codeblocks io.atom.Atom com.visualstudio.code-oss org.freedesktop.Sdk.Extension.freepascal org.geany.Geany io.github.cudatext.CudaText-Qt5"

	# Dados para a categoria "devbd"
	xiva_appstream_CATEGORIES["devbd"]="dbeaver mysql-workbench mariadb phpmyadmin postgresql pgadmin4 phppgadmin mysql mongodb-tools-bin mongodb-bin"
	# xiva_flatpak_CATEGORIES["devbd"]="Adicione aqui se necessário"

	# Dados para a categoria "devwebserver"
	xiva_appstream_CATEGORIES["devwebserver"]="apache nginx"
	# xiva_flatpak_CATEGORIES["devwebserver"]="Adicione aqui se necessário"

	# Dados para a categoria "devgames"
	xiva_appstream_CATEGORIES["devgames"]="godot gb-studio-bin blender renpy unity-editor unreal-engine makehuman-git"
	# xiva_flatpak_CATEGORIES["devgames"]="Adicione aqui se necessário"

	# Dados para a categoria "audioplayer"
	xiva_appstream_CATEGORIES["audioplayer"]="clementine audacious elisa rhythmbox qmmp deadbeef lollypop quodlibet strawberry spotify"
	# xiva_flatpak_CATEGORIES["audioplayer"]="Adicione aqui se necessário"

	# Dados para a categoria "radio"
	xiva_appstream_CATEGORIES["radio"]="vocal gnome-podcasts gogglesmm gpodder great-little-radio-player radiotray-ng shortwave odio-appimage goodvibes gradio streamtuner2 tuner"
	# xiva_flatpak_CATEGORIES["radio"]="Adicione aqui se necessário"

	# Dados para a categoria "audioconvert"
	xiva_appstream_CATEGORIES["audioconvert"]="gnome-sound-recorder soundkonverter ciano gnac soundconverter audacity"
	# xiva_flatpak_CATEGORIES["audioconvert"]="Adicione aqui se necessário"

	# Dados para a categoria "audioeditor"
	xiva_appstream_CATEGORIES["audioeditor"]="audacity kwave lmms ardour mixxx Rosegarden qtractor hydrogen cecilia ocenaudio-bin"
	# xiva_flatpak_CATEGORIES["audioeditor"]="Adicione aqui se necessário"

	# Dados para a categoria "videoplayer"
	xiva_appstream_CATEGORIES["videoplayer"]="smplayer vlc kodi-x11 mpv totem celluloid parole"
	# xiva_flatpak_CATEGORIES["videoplayer"]="Adicione aqui se necessário"

	# Dados para a categoria "imageplayer"
	xiva_appstream_CATEGORIES["imageplayer"]="gwenview eog shotwell gthumb digikam ristretto kphotoalbum phototonic viewnior"
	# xiva_flatpak_CATEGORIES["imageplayer"]="Adicione aqui se necessário"

	# Dados para a categoria "imageeditor"
	xiva_appstream_CATEGORIES["imageeditor"]="gimp krita inkscape pinta kolourpaint drawing scribus digikam rawtherapee fotoxx gravit-designer-bin sK1"
	# xiva_flatpak_CATEGORIES["imageeditor"]="Adicione aqui se necessário"

	# Dados para a categoria "dvd"
	xiva_appstream_CATEGORIES["dvd"]="k3b brasero dvdstyler devede xfburn acetoneiso2"
	# xiva_flatpak_CATEGORIES["dvd"]="Adicione aqui se necessário"

	# Dados para a categoria "webcam"
	xiva_appstream_CATEGORIES["webcam"]="obs-studio cheese kamoso simplescreenrecorder vokoscreen peek v4l-utils"
	# xiva_flatpak_CATEGORIES["webcam"]="Adicione aqui se necessário"

	# Dados para a categoria "screenshot"
	xiva_appstream_CATEGORIES["screenshot"]="spectacle gnome-screenshot flameshot pantheon-screenshot ksnip kazam screencloud"
	# xiva_flatpak_CATEGORIES["screenshot"]="Adicione aqui se necessário"

	# Dados para a categoria "imageconvert"
	xiva_appstream_CATEGORIES["imageconvert"]="converseen ciano xnconvert"
	# xiva_flatpak_CATEGORIES["imageconvert"]="Adicione aqui se necessário"

	# Dados para a categoria "3d"
	xiva_appstream_CATEGORIES["3d"]="blender wings3d sweethome3d freecad openscad cura librecad qcad godot gb-studio-bin meshroom-bin unity-editor unreal-engine makehuman-git brlcad"
	# xiva_flatpak_CATEGORIES["3d"]="Adicione aqui se necessário"

	# Dados para a categoria "gameretroarch"
	xiva_appstream_CATEGORIES["gameretroarch"]="retroarch-biglinux retroarch retroarch-assets-glui retroarch-assets-ozone retroarch-assets-xmb libretro-beetle-pce
 	libretro-beetle-pce-fast libretro-beetle-psx libretro-beetle-psx-hw libretro-beetle-supergrafx libretro-blastem libretro-bsnes libretro-bsnes-hd libretro-bsnes2014
 	libretro-citra	libretro-core-info libretro-desmume libretro-dolphin libretro-duckstation libretro-flycast libretro-gambatte libretro-genesis-plus-gx libretro-kronos
 	libretro-melonds libretro-mesen libretro-mesen-s libretro-mgba libretro-mupen64plus-next libretro-nestopia libretro-overlays libretro-parallel-n64 libretro-picodrive
 	libretro-play libretro-ppsspp	libretro-retrodream libretro-sameboy libretro-scummvm libretro-shaders-slang libretro-snes9x libretro-yabause"
	# xiva_flatpak_CATEGORIES["gameretroarch"]="Adicione aqui se necessário"

	# Dados para a categoria "gameemulator"
	xiva_appstream_CATEGORIES["gameemulator"]="desmume dgen-sdl dolphin-emu dosbox dosemu fceux fs-uae fs-uae-launcher hatari higan mame mame-tools qmc2 maui-station mednafen
 	mgba-qt	mupen64plus pcsx2 ppsspp snes9x-gtk stella vbam-wx vice yabause-qt gens-gs zsnes cemu duckstation-qt-bin epsxe yuzu-mainline-bin rpcs3-bin ryujinx-ldn-bind citra-bin
 	fightcade2	melonds nestopia flycast-git m64p openmsx"
	# xiva_flatpak_CATEGORIES["gameemulator"]="Adicione aqui se necessário"

	# Dados para a categoria "gamemanager"
	xiva_appstream_CATEGORIES["gamemanager"]="steam-manjaro steam-native lutris playonlinux gamehub-bin itch gnome-games heroic-games-launcher-bin"
	# xiva_flatpak_CATEGORIES["gamemanager"]="Adicione aqui se necessário"

	# Dados para a categoria "gamearcade"
	xiva_appstream_CATEGORIES["gamearcade"]="minetest xonotic supertux supertuxkart abuse warzone2100 warsow frozen-bubble pingus armagetronad astromenace barrage knavalbattle
 	kspaceduel blobby blobwars fltk-examples bomber chromium-bsu cuyo endless-sky extremetuxracer gnome-nibbles gnome-robots gnujump granatier hedgewars kapman kblackbox kbounce
 	kbreakout kgoldrunner killbots klickety kobodeluxe kolf kolision ksnakeduel lbreakout2 ltis quadrapassel sauerbraten teeworlds uqm frogatto apricots"
	# xiva_flatpak_CATEGORIES["gamearcade"]="Adicione aqui se necessário"

	# Dados para a categoria "gamecard"
	xiva_appstream_CATEGORIES["gamecard"]="kpat lskat aisleriot pysolfc"
	# xiva_flatpak_CATEGORIES["gamecard"]="Adicione aqui se necessário"

	# Dados para a categoria "gamestrategy"
	xiva_appstream_CATEGORIES["gamestrategy"]="0ad wesnoth konquest freeciv glob2 klines ksirk lincity-ng openra widelands"
	# xiva_flatpak_CATEGORIES["gamestrategy"]="Adicione aqui se necessário"

	# Dados para a categoria "gamepuzzle"
	xiva_appstream_CATEGORIES["gamepuzzle"]="atomix puzzles kmines gnome-mines fillets-ng gnome-2048 hitori gnome-klotsky gnome-taquin gnome-tetravex kblocks kdiamond knetwalk
	lightsoff palapeli picmi zaz"
	# xiva_flatpak_CATEGORIES["gamepuzzle"]="Adicione aqui se necessário"

	# Dados para a categoria "gameboard"
	xiva_appstream_CATEGORIES["gameboard"]="bovo five-or-more gnome-mahjongg iagno gnome-sudoku gnome-chess kajongg kfourinline four-in-a-row kigo kjumpingcube kmahjongg knights
	kshisen ksquares ksudoku pychess qgo kreversi swell-foop xboard"
	# xiva_flatpak_CATEGORIES["gameboard"]="Adicione aqui se necessário"

	# Dados para a categoria "gamerpg"
	xiva_appstream_CATEGORIES["gamerpg"]="freedroidrpg manaplus megaglest naev openmw scummvm springlobby"
	# xiva_flatpak_CATEGORIES["gamerpg"]="Adicione aqui se necessário"

	# Dados para a categoria "gameother"
	xiva_appstream_CATEGORIES["gameother"]="kiriki openbve openrct2 openttd peformous simutrans tali"
	# xiva_flatpak_CATEGORIES["gameother"]="Adicione aqui se necessário"

	# Dados para a categoria "gameeducational"
	xiva_appstream_CATEGORIES["gameeducational"]="atomix blinken gbrainy gcompris-qt ktuberling kanagram katomic khangman kubrick kturtle minuet cantor kalgebra kalzium kbruch
	kgeography kig kiten klettres ktouch kwordquiz parley solfege step"
	# xiva_flatpak_CATEGORIES["gameeducational"]="Adicione aqui se necessário"

	# Dados para a categoria "gameutility"
	xiva_appstream_CATEGORIES["gameutility"]="goverlay-bin mangohud-x11 gamepad-tool-bin gamemode qt5-gamepad adriconf joyutils corectrl winetricks"
	# xiva_flatpak_CATEGORIES["gameutility"]="Adicione aqui se necessário"

	# Dados para a categoria "javajar"
	xiva_appstream_CATEGORIES["javajar"]="jre-openjdk jre7-openjdk jre8-openjdk jre11-openjdk icedtea-web jre jre6 jre7 jre8 jre9 jre10 jre11 jre12 jre14"
	# xiva_flatpak_CATEGORIES["javajar"]="Adicione aqui se necessário"

	# Dados para a categoria "storage"
	xiva_appstream_CATEGORIES["storage"]="gparted partitionmanager bleachbit gnome-dist-utility kdiskmark gsmartcontrol mintstick baobab filelight balena-etcher ventoy
	gnome-multi-writer"
	xiva_flatpak_CATEGORIES["storage"]="org.kde.filelight"

	# Dados para a categoria "virtualization"
	xiva_appstream_CATEGORIES["virtualization"]="virtualbox virtualbox-guest-utils virt-manager qemu qemu-guest-agent gnome-boxes"
	# xiva_flatpak_CATEGORIES["virtualization"]="Adicione aqui se necessário"
}

function sh_cleanup() {
	[[ -e "$TMP_FOLDER/category_aur.txt" ]] && rm -f "$TMP_FOLDER/category_aur.txt"
}

function sh_main() {
	local category="$1"
	local appstream_packages
	local flatpak_packages
	local aexceptions=(network news book devwebserver gameretroarch)

	sh_cleanup
	[[ -n "$category" ]] && {
		appstream_packages="${xiva_appstream_CATEGORIES[$category]}"
		aur_packages="${xiva_flatpak_CATEGORIES[$category]}"
		flatpak_packages="${xiva_flatpak_CATEGORIES[$category]}"
		snap_packages="${xiva_flatpak_CATEGORIES[$category]}"

	    [[ -n "$appstream_packages" ]] && appstream_search_category=1 APPSTREAM_CATEGORY "$appstream_packages"
		[[ -n "$aur_packages"       ]] && aur_search_category=1       AUR_CATEGORY "$aur_packages"
        [[ -n "$flatpak_packages"   ]] && flatpak_search_category=1   FLATPAK_CATEGORY "$flatpak_packages"
        [[ -n "$snap_packages"      ]] && snap_search_category=1      SNAP_CATEGORY "$snap_packages"

#		case "$category" in
#		network | news | book | devwebserver | gameretroarch) ;;
#		*) [[ -n "$aur_packages" ]] && aur_search_category=1 AUR_CATEGORY "$aur_packages";;
#		esac
	}
}

#sh_debug
sh_config
sh_main "$category"
