How to allow apps to take screenshots in wayland?

I used to use flameshot in my Fedora on Wayland(Gnome). When i first launched it via “flameshot gui” the system asked whether i allow flameshot to take screenshots or something like that i clicked yes and everything worked. This time when i installed fedora, flameshot and launched it i accidentally clicked “Esc” and the prompt was closed. So i tried launching it again, but no prompt was showed again, instead i only see this error.
image

How can i allow flameshot to take screenshots again? I tried reinstalling the app, but it didn’t work. I can theoretically reinstall the whole OS, but that just seem a bit of an overkill.

1 Like

Ok, don’t ask me more. :slightly_smiling_face: I’m not an expert and the topic seems a bit tangled.
Such permission seems to be stored on some xdg-desktop-portal (?) database, key/value store. Whatever.
You can interact with it using dbus.
There is also a GUI qt-qdbusviewer, but it doesn’t look so simple.
However.

From the command line, the reply to this command
dbus-send --session --print-reply=literal --dest=org.freedesktop.impl.portal.PermissionStore /org/freedesktop/impl/portal/PermissionStore org.freedesktop.impl.portal.PermissionStore.Lookup string:'screenshot' string:'screenshot'
in your case probably is

   array [
      dict entry(
                  array [
            no         ]
      )
   ]
   variant       byte 0

You should put it to “yes”.

Well, this Python script Solved: Re: Constantly asking for permission to share... - Upwork Community seems to do the job.

However you could “reset” such PermissionStore with this command

dbus-send --session --print-reply=literal --dest=org.freedesktop.impl.portal.PermissionStore /org/freedesktop/impl/portal/PermissionStore org.freedesktop.impl.portal.PermissionStore.DeletePermission string:'screenshot' string:'screenshot' string:''

Now

dbus-send --session --print-reply=literal --dest=org.freedesktop.impl.portal.PermissionStore /org/freedesktop/impl/portal/PermissionStore org.freedesktop.impl.portal.PermissionStore.Lookup string:'screenshot' string:'screenshot'

returns

   array [
   ]
   variant       byte 0

And now relaunch flameshot gui and the spoke asking the permission for applications to take screenshots should appear again. This time select “Allow”.

If you look at such value again:

dbus-send --session --print-reply=literal --dest=org.freedesktop.impl.portal.PermissionStore /org/freedesktop/impl/portal/PermissionStore org.freedesktop.impl.portal.PermissionStore.Lookup string:'screenshot' string:'screenshot'

Now the result should be:

   array [
      dict entry(
                  array [
            yes         ]
      )
   ]
   variant       byte 0
1 Like

At the end of the day, it looks to me that this is something that is not still fully implemented. Indeed the spoke asking for permission to take screenshots talks about “you can subsequently manage the permission in the privacy tab” in GNOME Settings. But if you go there, there is not such permission. And also in Settings, under the single App permissions, there is no trace of it.
Hopefully this feature will be implemented in the future since the underlying infrastructure is already in place.

1 Like

@alciregi this works like a charm, i can’t tell you how grateful i am, thank you very much)