Add a button to uninstall apps in their app page in GNOME Settings

Since https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/1389 GNOME Software can now uninstall apps via the command line. There should be a button in the app pages named ‘Uninstall’ to uninstall the app in GNOME Settings in my opinion which then would trigger the GNOME Software command to uninstall the specific app. What’s your opinion on that topic?
Continuation of https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1898

1 Like

As mentioned in the similar gnome-shell issue:

  • gnome-software expects a valid AppStream data ID (like /system/flatpak/flathub/org.gnome.Polari/stable). Getting scope, packaging format, origin and branch would require replicating much of gnome-software’s packaging abstraction (at least PackageKit and flatpak), and that’s massively out of scope for gnome-shell (and I reckon Settings as well)
  • some core apps (like Settings or Software) are protected, that is they cannot be uninstalled. It would be better to not offer uninstall in that case, instead of showing an error when trying. But that would require more API in Software to expose whether a particular app can be uninstalled or not

The 2nd issue is somewhat cosmetic, but the 1st one is a show stopper. If we cannot use the information we have - basically the basename of the .desktop file, with or without the suffix - then the command line flag / D-Bus action is mostly useless to us.

gnome-software expects a valid AppStream data ID (like /system/flatpak/flathub/org.gnome.Polari/stable).

Ha, and just after writing this I discover that unknown can be used as a placeholder, like /unknown/unknown/unknown/org.gnome.Polari/unknown.

So that’s the main concern out of way :person_shrugging:

1 Like

So there are two options:

  • Add the uninstall button to every app and show an error when you click on the uninstall button of an app which is protected

  • Wait (and hope) that Software implements something over which Settings could read if the app is uninstallable or not and display the button only if the app is uninstallable

Yes, except that in the first case Software doesn’t do anything (unless we count a warning message in the journal).

Another approach I could see is implementing the call directly in Software, which would allow Software to do all the heavy lifting. But that raises another important point - why not just have people click “Open in Software” like they currently do? It’s one more click at the worst and saves a lot of development time, not to mention is far more maintainable.

That is what is being discussed. Settings/shell would simply activate a remote action in Software, which then takes care of asking for confirmation and performing the action.

Ah - that context was not present in the original issue, where it seemed like the code would be duplicated into Settings.