Last active
April 15, 2020 21:54
-
-
Save wjt/650a1b2dc83c65661e6a7031495b6be2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| org.kde.\*=own | |
| ============== | |
| com.borgbase.Vorta org.kde.* own | |
| com.dropbox.Client org.kde.* own | |
| org.kde.StatusNotifierItem=own | |
| ============================== | |
| com.github.Qv2ray org.kde.StatusNotifierItem-2-1 own | |
| com.obsproject.Studio org.kde.StatusNotifierItem-2-2 own | |
| com.ulduzsoft.Birdtray org.kde.StatusNotifierItem-2-2 own | |
| info.mumble.Mumble org.kde.StatusNotifierItem-2-2 own | |
| org.clementine_player.Clementine org.kde.StatusNotifierItem-2-2 own | |
| org.gyunaev.Birdtray org.kde.StatusNotifierItem-2-2 own | |
| org.qownnotes.QOwnNotes org.kde.StatusNotifierItem-3-1 own | |
| org.kde.StatusNotifierWatcher=talk | |
| ================================== | |
| cc.retroshare.retroshare-gui | |
| chat.rocket.RocketChat | |
| com.bitwarden.desktop | |
| com.discordapp.Discord | |
| com.dropbox.Client | |
| com.elsevier.MendeleyDesktop | |
| com.georgefb.quickaccess | |
| com.getferdi.Ferdi | |
| com.github.IsmaelMartinez.teams_for_linux | |
| com.github.Qv2ray | |
| com.github.bajoja.indicator-kdeconnect | |
| com.github.bitseater.weather | |
| com.github.hluk.copyq | |
| com.github.rssguard | |
| com.gitlab.bitseater.meteo | |
| com.googleplaymusicdesktopplayer.GPMDP | |
| com.greyrook.siptop | |
| com.icanblink.blink | |
| com.leinardi.gkraken | |
| com.leinardi.gwe | |
| com.leinardi.gx52 | |
| com.meetfranz.Franz | |
| com.microsoft.Teams | |
| com.musixmatch.Musixmatch | |
| com.nordpass.NordPass | |
| com.obsproject.Studio | |
| com.skype.Client | |
| com.slack.Slack | |
| com.toggl.TogglDesktop | |
| com.transmissionbt.Transmission | |
| com.ulduzsoft.Birdtray | |
| com.valvesoftware.Steam | |
| com.viber.Viber | |
| cx.ring.Ring | |
| im.riot.Riot | |
| info.mumble.Mumble | |
| io.botfather.Botfather | |
| io.github.NhekoReborn.Nheko | |
| io.github.Pithos | |
| io.github.kotatogram | |
| io.github.liberodark.OpenDrive | |
| io.github.mujx.Nheko | |
| io.github.qtox.qTox | |
| io.github.quodlibet.QuodLibet | |
| me.kozec.syncthingtk | |
| net.jami.Jami | |
| org.clementine_player.Clementine | |
| org.equeim.Tremotesf | |
| org.eu.encom.matrique | |
| org.eu.encom.spectral | |
| org.gyunaev.Birdtray | |
| org.kde.konversation | |
| org.keepassxc.KeePassXC | |
| org.mobsya.ThymioSuite | |
| org.nextcloud.Nextcloud | |
| org.qbittorrent.qBittorrent | |
| org.qownnotes.QOwnNotes | |
| org.quassel_irc.QuasselClient | |
| org.remmina.Remmina | |
| org.signal.Signal | |
| org.sparkleshare.SparkleShare | |
| org.tabos.roger | |
| org.telegram.desktop | |
| org.vranki.spectral | |
| org.zealdocs.Zeal | |
| org.zim_wiki.Zim | |
| org.zulip.Zulip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import re | |
| from gi.repository import Flatpak, GLib | |
| SESSION_BUS_POLICY = "Session Bus Policy" | |
| INDICATORY_PERMISSIONS = { | |
| r"org.kde.\*": "own", | |
| r"org.kde.StatusNotifierItem": "own", | |
| r"org.kde.StatusNotifierWatcher": "talk", | |
| } | |
| def parse_metadata(app_ref: Flatpak.RemoteRef): | |
| data = app_ref.get_metadata() | |
| keyfile = GLib.KeyFile() | |
| keyfile.load_from_bytes(data, GLib.KeyFileFlags.NONE) | |
| return keyfile | |
| def main(): | |
| (installation,) = Flatpak.get_system_installations() | |
| refs = installation.list_remote_refs_sync_full("flathub", Flatpak.QueryFlags.NONE) | |
| app_refs = [ | |
| r | |
| for r in refs | |
| if r.get_kind() == Flatpak.RefKind.APP and r.get_arch() == "x86_64" | |
| ] | |
| for name, permission in INDICATORY_PERMISSIONS.items(): | |
| header = f"{name}={permission}" | |
| print(header) | |
| print("=" * len(header)) | |
| rx = re.compile(name) | |
| apps = [] | |
| for app_ref in app_refs: | |
| metadata = parse_metadata(app_ref) | |
| try: | |
| policy_keys, _ = metadata.get_keys(SESSION_BUS_POLICY) | |
| except GLib.GError: | |
| continue | |
| for key in policy_keys: | |
| value = metadata.get_string(SESSION_BUS_POLICY, key) | |
| if rx.match(key) and value == permission: | |
| if key == name: | |
| apps.append((app_ref.get_name(),)) | |
| else: | |
| apps.append((app_ref.get_name(), key, value)) | |
| apps.sort() | |
| for app in apps: | |
| print(*app) | |
| print() | |
| if __name__ == "__main__": | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment