From 5892da24ed9472675f43da19594089dc8b40d255 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Thu, 4 Jan 2024 15:56:36 -0800 Subject: [PATCH] feat: Switch to system level flatpaks --- usr/bin/ublue-system-flatpak-manager | 11 ++++++++--- usr/bin/ublue-user-flatpak-manager | 8 ++++++-- usr/etc/flatpak/system/install | 22 ++++++++++++++++++++++ usr/etc/flatpak/user/install | 22 ---------------------- usr/etc/flatpak/user/remove | 22 ++++++++++++++++++++++ 5 files changed, 58 insertions(+), 27 deletions(-) diff --git a/usr/bin/ublue-system-flatpak-manager b/usr/bin/ublue-system-flatpak-manager index 76142f8f9c6..f1e08b057a7 100755 --- a/usr/bin/ublue-system-flatpak-manager +++ b/usr/bin/ublue-system-flatpak-manager @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Script Version -VER=1 +VER=2 VER_FILE="/etc/ublue/flatpak_manager_version" VER_RAN=$(cat $VER_FILE) @@ -11,11 +11,16 @@ if [[ -f $VER_FILE && $VER = $VER_RAN ]]; then exit 0 fi -# Remove fedora flatpak repo +# Opt out of and remove Fedora's flatpak repo if grep -qz 'fedora' <<< $(flatpak remotes); then - flatpak remote-delete --user fedora --force + /usr/lib/fedora-third-party/fedora-third-party-opt-out + /usr/bin/fedora-third-party disable + flatpak remote-delete fedora --force fi +# Ensure Flathub is enabled +flatpak remote-modify --system --enable flathub + # Lists of flatpaks FLATPAK_LIST=$(flatpak list --columns=application) INSTALL_LIST=$(cat /etc/flatpak/system/install) diff --git a/usr/bin/ublue-user-flatpak-manager b/usr/bin/ublue-user-flatpak-manager index 24340369896..029649c1460 100755 --- a/usr/bin/ublue-user-flatpak-manager +++ b/usr/bin/ublue-user-flatpak-manager @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Script Version -VER=1 +VER=2 VER_FILE="$HOME/.ublue_flatpak_manager_version" VER_RAN=$(cat $VER_FILE) @@ -11,8 +11,12 @@ if [[ -f $VER_FILE && $VER = $VER_RAN ]]; then exit 0 fi -# Setup Flathub +# Enable Flathub +if grep -qz 'fedora' <<< $(flatpak remotes); then + flatpak remote-delete --user fedora --force +fi flatpak remote-add --if-not-exists --user flathub /etc/flatpak/remotes.d/flathub.flatpakrepo +flatpak remote-modify --user --enable flathub # Lists of flatpaks FLATPAK_LIST=$(flatpak list --columns=application) diff --git a/usr/etc/flatpak/system/install b/usr/etc/flatpak/system/install index e69de29bb2d..c4a26c34faa 100644 --- a/usr/etc/flatpak/system/install +++ b/usr/etc/flatpak/system/install @@ -0,0 +1,22 @@ +org.mozilla.firefox +org.freedesktop.Platform.ffmpeg-full//22.08 +org.gnome.Calculator +org.gnome.Calendar +org.gnome.Characters +org.gnome.Connections +org.gnome.Contacts +org.gnome.Evince +org.gnome.Loupe +org.gnome.Logs +org.gnome.Maps +org.gnome.NautilusPreviewer +org.gnome.TextEditor +org.gnome.Weather +org.gnome.baobab +org.gnome.clocks +org.gnome.font-viewer +com.mattjakeman.ExtensionManager +com.github.tchx84.Flatseal +org.fedoraproject.MediaWriter +io.missioncenter.MissionCenter +io.github.celluloid_player.Celluloid diff --git a/usr/etc/flatpak/user/install b/usr/etc/flatpak/user/install index c4a26c34faa..e69de29bb2d 100644 --- a/usr/etc/flatpak/user/install +++ b/usr/etc/flatpak/user/install @@ -1,22 +0,0 @@ -org.mozilla.firefox -org.freedesktop.Platform.ffmpeg-full//22.08 -org.gnome.Calculator -org.gnome.Calendar -org.gnome.Characters -org.gnome.Connections -org.gnome.Contacts -org.gnome.Evince -org.gnome.Loupe -org.gnome.Logs -org.gnome.Maps -org.gnome.NautilusPreviewer -org.gnome.TextEditor -org.gnome.Weather -org.gnome.baobab -org.gnome.clocks -org.gnome.font-viewer -com.mattjakeman.ExtensionManager -com.github.tchx84.Flatseal -org.fedoraproject.MediaWriter -io.missioncenter.MissionCenter -io.github.celluloid_player.Celluloid diff --git a/usr/etc/flatpak/user/remove b/usr/etc/flatpak/user/remove index e69de29bb2d..c4a26c34faa 100644 --- a/usr/etc/flatpak/user/remove +++ b/usr/etc/flatpak/user/remove @@ -0,0 +1,22 @@ +org.mozilla.firefox +org.freedesktop.Platform.ffmpeg-full//22.08 +org.gnome.Calculator +org.gnome.Calendar +org.gnome.Characters +org.gnome.Connections +org.gnome.Contacts +org.gnome.Evince +org.gnome.Loupe +org.gnome.Logs +org.gnome.Maps +org.gnome.NautilusPreviewer +org.gnome.TextEditor +org.gnome.Weather +org.gnome.baobab +org.gnome.clocks +org.gnome.font-viewer +com.mattjakeman.ExtensionManager +com.github.tchx84.Flatseal +org.fedoraproject.MediaWriter +io.missioncenter.MissionCenter +io.github.celluloid_player.Celluloid