#!/bin/bash main(){ if [[ "$(whoami)" != "root" ]];then bash ./error.sh "Must be root (current: $USER)"; exit 1; fi run_apps_install; } _install_app(){ local name=$1; # looks like com.microcrap.garbage local app_name_extracted=$(echo "$name" | awk -F"." "{ $3 }"); if ! command -v "$app_name_extracted" &> /dev/null; then bash ./warn.sh "Installing ... $app_name_extracted" flatpak install flathub "$name" --assumeyes bash ./success.sh "$app_name_extracted installed successfully" else bash ./warn.sh "$app_name_extracted already installed" fi } run_apps_install(){ echo "########################### App Installations #######################" local flatpak_apps=( "com.microsoft.Edge" "io.github.zen_browser.zen" "dev.vencord.Vesktop" "org.blender.Blender" "org.godotengine.Godot" "de.haeckerfelix.Shortwave" "org.gnome.Solanum" "com.valvesoftware.Steam" "com.mattjakeman.ExtensionManager" "org.gnome.design.Emblem" ) for i in "${flatpak_apps[@]}"; do _install_app "${i}"; done; } main;