SUMMARY When adding Flathub from Discover, ask if the user wants to add the repository system-wide or for the current user only. Also, keep showing the button to add Flathub even when it's already enabled because that way the user can still add another instance of the Flathub repo (eg. if the system-wide repo is enabled, if you keep the Add Flathub button, you can also add Flathub to the user and have two Flathub repositories for each occasion. When installing, you can simply select if you want to install an app system-wide or for the user with the Sources dropdown menu next to the install button). STEPS TO REPRODUCE 1. With no Flatpak repositories enabled, open Discover 2. Go to Settings 3. Click on Add Flathub OBSERVED RESULT Discover always adds Flathub system-wide. This is not always desired. For instance, if you have a separate home partition, installing Flatpak apps for the user only (flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo) allows you to keep your programs on your home partition, that way, if it's on another disk, you get more space for programs and you can also alleviate space constraints in the system partition. EXPECTED RESULT Ask the user if they want to add the Flathub repository for the user only or system-wide. Keep the button visible until both types of repositories are enabled. SOFTWARE/OS VERSIONS Operating System: openSUSE Tumbleweed 20230225 KDE Plasma Version: 5.27.1 KDE Frameworks Version: 5.103.0 Qt Version: 5.15.8 Kernel Version: 6.1.12-1-default (64-bit) Graphics Platform: Wayland Processors: 4 × Intel® Core™ i5-6200U CPU @ 2.30GHz Memory: 3.7 GiB of RAM Graphics Processor: Mesa Intel® HD Graphics 520 Manufacturer: Acer Product Name: Aspire F5-573 System Version: V1.27
What we should probably do is abstract this all away from the user and let them choose on a per-app basis whether they want to install apps systemwide or only for the current user, with the default setting they can change if they want.