elementary / switchboard-plug-parental-controls

Switchboard Screen Time & Limits Plug
https://elementary.io
GNU General Public License v3.0
11 stars 14 forks source link

Use malcontent to block flatpak applications #144

Closed davidmhewitt closed 3 years ago

davidmhewitt commented 3 years ago

Fixes #139

Has a runtime dependency on malcontent

Due to the way that applications are currently blocked by Parental Controls using the executable name, and that all flatpak applications use flatpak as their executable, it wasn't going to be possible to use this existing method for flatpaks.

This uses malcontent for Flatpak desktop files only, as flatpak has built in support for malcontent. If an application has been filtered for the current user in malcontent, the flatpak executable will refuse to start it.

Currently, blocked flatpaks still remain visible in the applications menu and do nothing when you click on them (which isn't great UX), but is outside the scope of this PR. We'll need to do some work on the applications menu (and maybe the dock) to resolve this.

danirabbit commented 3 years ago

Hm, running this I get:

** (io.elementary.switchboard:2468): WARNING **: 15:32:31.588: AppsView.vala:232: Unable to get malcontent app filter: App filtering is globally disabled
davidmhewitt commented 3 years ago

@danrabbit Right, I would guess that's because we introduce a runtime dependency on malcontent here and it's possibly not installed on your machine? We'll need to remember to add that to the runtime depends.