Score:0

How to give portal access to a Flatpak app using cli

cn flag

After installing and launching the app com.tomjwatson.Emote I get prompted to give it the Background portal access. I know I can toggle access to a portal conveniently via the Flatseal app, but I am looking for a solution that works from a bash script setting up a computer - with as little user GUI action as possible.

When manually giving access via Flatseal (presumably the same from the initial launch prompt), I get this output:

$ flatpak permission-show com.tomjwatson.Emote
Table      Object     App                  Permissions Data
background background com.tomjwatson.Emote yes         0x00

How can I give access to that portal via the command line?

After reading the terse documentation (I wish it had some examples), I tried some variations of the flatpak permission-set command:

$ flatpak permission-set background com.tomjwatson.Emote yes
$ flatpak permission-show com.tomjwatson.Emote

$ flatpak permission-set background com.tomjwatson.Emote
error: Too few arguments

See 'flatpak permission-set --help'
$ flatpak permission-set background com.tomjwatson.Emote background
$ flatpak permission-show com.tomjwatson.Emote

$ flatpak permission-set background com.tomjwatson.Emote background yes
$ flatpak permission-show com.tomjwatson.Emote

$ flatpak permission-set background com.tomjwatson.Emote --data=0x00
error: Too few arguments

See 'flatpak permission-set --help'
$ flatpak permission-set background com.tomjwatson.Emote background --data=0x00
$ flatpak permission-show com.tomjwatson.Emote

$ flatpak permission-set background com.tomjwatson.Emote background yes --data=0x00
$ flatpak permission-show com.tomjwatson.Emote

$ flatpak permission-set background com.tomjwatson.Emote yes --data=0x00
$ flatpak permission-show com.tomjwatson.Emote

$ flatpak permission-set background --data=0x00 com.tomjwatson.Emote
error: Too few arguments

See 'flatpak permission-set --help'
$ flatpak permission-set background --data=0x00 com.tomjwatson.Emote yes
$ flatpak permission-show com.tomjwatson.Emote

$ flatpak permission-set background --data=0x00 com.tomjwatson.Emote true
$ flatpak permission-show com.tomjwatson.Emote

$ flatpak permission-set background --data=0x00 com.tomjwatson.Emote background
$ flatpak permission-show com.tomjwatson.Emote

Note: I expected to get the same flatpak permission-show output as at the top (having used Flatseal) if I hit a working command - I didn't check Flatseal or manually test if the app can run in the background.

Should I instead be using flatpak override?

What am I doing wrong?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.