#!/bin/bash
# Macroscop Repository

declare -A osInfo;
osInfo[/etc/altlinux-release]=apt-get
osInfo[/etc/redhat-release]=dnf
osInfo[/etc/arch-release]=pacman
osInfo[/etc/gentoo-release]=emerge
osInfo[/etc/SuSE-release]=zypp
osInfo[/etc/debian_version]=apt-get
osInfo[/etc/alpine-release]=apk

for f in ${!osInfo[@]}
do
  if [[ -f $f ]];then
    sudo ${osInfo[$f]} install -y flatpak
  fi
done

sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

sudo flatpak remote-add --if-not-exists macroscop https://packages.macroscop.com/flatpak/macroscop.flatpakrepo

