Skip to content

Instantly share code, notes, and snippets.

@iodar
Created April 3, 2024 20:35
Show Gist options
  • Save iodar/0ff803d3162f123396b27a3bf5814f1a to your computer and use it in GitHub Desktop.
Save iodar/0ff803d3162f123396b27a3bf5814f1a to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Installs flatpak and configures 'flathub' as a repository for
# ubunut, mint or debian.
function get-dist-id {
echo "$(lsb_release -i | tail -n +1 | sed -Er "s/.*\:[[:space:]]//")"
}
function echo-install-prompt {
echo "Starting flatpak install"
echo "You will get asked your sudo password in order to install flatpak"
}
function install-ubuntu {
echo-install-prompt
sudo add-apt-repository -y ppa:flatpak/stable
sudo apt update
sudo apt install flatpak
sudo apt install gnome-software-plugin
}
function install-debian {
echo-install-prompt
sudo apt install flatpak
CURRENT_DESKTOP="$(env | grep XDG_CURRENT_DESKTOP | sed -r "s/XDG_CURRENT_DESKTOP=//")"
case "$CURRENT_DESKTOP" in
GNOME)
sudo apt install plasma-discover-backend-flatpak
;;
KDE)
sudo apt install gnome-software-plugin-flatpak
;;
esac
}
function configure-flathub {
echo "Adding 'flathub' as repository for 'flatpak'"
sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
}
DIST_ID="$(get-dist-id)"
case "$DIST_ID" in
ubuntu)
install-ubuntu
configure-flathub
;;
debian)
install-debian
configure-flathub
;;
Linuxmint)
configure-flathub
;;
esac
#!/bin/bash
function install-makemkv {
flatpak install flathub com.makemkv.MakeMKV
}
echo "Installing MakeMKV from 'flathub'"
install-makemkv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment