Created
January 17, 2026 15:39
-
-
Save nukhes/899291eef2149f8862df68f3ab2199a6 to your computer and use it in GitHub Desktop.
Distribution-agnostic tool designed to deploy the Flatpak across multiple Linux environments silently.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [[ $EUID -ne 0 ]]; then | |
| exit 1 | |
| fi | |
| declare -A os_map=( | |
| ["apt"]="apt install -qq -y flatpak" | |
| ["dnf"]="dnf install -y -q flatpak" | |
| ["pacman"]="pacman -S --noconfirm --needed --quiet flatpak" | |
| ["zypper"]="zypper --quiet install -y flatpak" | |
| ["apk"]="apk add --quiet flatpak" | |
| ["xbps-install"]="xbps-install -y -Q flatpak" | |
| ) | |
| install_flatpak() { | |
| for cmd in "${!os_map[@]}"; do | |
| if command -v "$cmd" &> /dev/null; then | |
| eval "${os_map[$cmd]}" > /dev/null 2>&1 | |
| return 0 | |
| fi | |
| done | |
| return 1 | |
| } | |
| setup_flathub() { | |
| flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo | |
| } | |
| main() { | |
| if install_flatpak; then | |
| if ! command -v flatpak &> /dev/null; then | |
| setup_flathub | |
| fi | |
| else | |
| exit 1 | |
| fi | |
| } | |
| main |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run with one command
curl -fsSL https://gist.githubusercontent.com/nukhes/899291eef2149f8862df68f3ab2199a6/raw/ | sudo sh