#!/bin/bash # games installations via flatpak set -uo pipefail if ! command -v flatpak >/dev/null 2>&1; then echo 'Error: flatpak is not installed.' >&2 echo 'Please install it with "sudo pacman -S flatpak" and reboot your system.' >&2 exit 1 fi flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo APPS=( app.drey.Blurble com.github.avojak.paint-spill io.github.garglk.Gargoyle io.github.nokse22.ultimate-tic-tac-toe io.github.swordpuffin.hunt io.github.swordpuffin.splices org.gnome.Aisleriot org.gnome.Chess org.gnome.Crosswords org.gnome.five-or-more org.gnome.Four-in-a-row org.gnome.gbrainy org.gnome.LightsOff org.gnome.Mahjongg org.gnome.Mines org.gnome.Quadrapassel org.gnome.Sudoku org.gnome.SwellFoop org.gnome.Taquin org.gnome.Tetravex org.gnome.TwentyFortyEight org.gottcode.Peg-E org.gottcode.Tanglet ) failed=() for app in "${APPS[@]}"; do if flatpak install --noninteractive --assumeyes --user flathub "$app"; then : else failed+=("$app") fi done if [ "${#failed[@]}" -gt 0 ]; then echo echo "Failed to install ${#failed[@]} app(s):" >&2 printf ' - %s\n' "${failed[@]}" >&2 exit 1 fi