-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Take Screenshot on Gnome without Prompt #2868
Comments
That portal change has been merged, and is part of the 1.15.0 release, and GNOME 43 will support that. The KDE portal implementation already skips the sharing dialog anyway, so it's not relevant. Requesting the screenshot permission happens the first time when using the GUI, and after that permission is granted, subsequent non-interactive screenshots should happen automatically. Taking screenshots from the CLI won't work without the permission. |
I sent the comment too early, sorry. Some more thoughts.
GNOME rejects permission requests from apps that are not the currently focused window, but xdg-desktop-portal only requests such permission if it's unset. If the user grants (or denies) the permission, it'll be stored and xdg-desktop-portal won't request it again. So if someone tries to take a screenshot using CLI, and it's the first time using the app, the permission request will fail. But in GNOME, people can go to Settings and manually grant Flameshot this permission using the Applications panel: I'm still considering whether or not this case should be covered, and how to do so, but keep this in mind for now. |
To be abundantly clear, Flameshot won't have to do anything other than using the Screenshot portal, and pass interactive=false. Everything else will be handled internally by xdg-desktop-portal and GNOME. |
Thanks for the additional info! I’ll try to get the change merged into Flameshot this weekend. |
@GeorgesStavracas thanks for the detailed explanation, and thanks for the PR you did for the xdg-desktop-portal. I will try to update our documentation on our website. Do you kind if I ask you later to review the updates in case I've missed or misunderstood something? |
Sure, just @ me and I can give it a read |
How I can resubmit request for the permission? Flameshot v12.1.0 (-) |
Hi guys, OS: Fedora 37, Wayland, Gnome 43, Flameshot: 12.1.0 installed using dnf, xdg-desktop-portal-1.15.0-1.fc37 What I did to make it work:
The same can be done for flameshot run from the terminal, or triggered by a keyboard shortcut. You need to run flameshot in the terminal instead of using gnome launcher, and repeat the above steps. In this case I don't know if it's the flameshot settings window that needs to be actively focused to trigger the permissions prompt. But it's one of those. In summary, I can now run flameshot from the tray icon, from terminal, from the ALT+F2(gnome's run command tool) and it takes screenshots without asking for permissions. |
Hi @jerzy-dudzic. Thanks for your 2 cents. I'm running the same version as you and I was able to grant permission running flameshot from its .desktop gnome menu. But when I try to run it from terminal it doesn't work (never asks for permission). Besides just 'flameshot' I also try running the same .desktop file (gtk4-launch org.flameshot.Flameshot.desktop) but same result: Could you provide more details on how you achieved to run flameshot from terminal? Or do you have any idea about what I am missing here. Thanks. |
How to request permissions? |
I just tested this on a second computer with Fedora 37. What worked for me is simply running I believe that for this to work the terminal window must not lose focus. It's just a guess but I suspect you might be able to set the keyboard shortcut to This theory is based on the quote of @GeorgesStavracas, although it's a bit counter-intuitive that it's the terminal window must be focused instead of flameshot. However maybe it's the terminal or even a shell that must be granted permissions for taking screenshots from the terminal. I don't know how to check those permissions. The quote is:
If anyone knows how to clear those permissions please let me know and I'll do some more tests. |
I'm using GNOME 43 in Fedora 37. I had a keyboard shortcut that worked nicely in Fedora 36, launching the command That one no longer works. Fails with:
I had to change it for Is there any way to make |
Yes, please, I have the exact same issue with the keyboard shortcut, unable to run with
|
I had the same issue. I probably said Here the script to execute: import dbus
bus = dbus.SessionBus()
perm = bus.get_object('org.freedesktop.impl.portal.PermissionStore', '/org/freedesktop/impl/portal/PermissionStore')
perm_iface = dbus.Interface(perm, dbus_interface='org.freedesktop.impl.portal.PermissionStore')
perm_iface.Lookup("screenshot", "screenshot")
perm_iface.Set("screenshot", dbus.Boolean(True), "screenshot", {"": ["yes"]}, dbus.Byte(0x00))
perm_iface.Lookup("screenshot", "screenshot") I found the solution here: https://community.upwork.com/t5/Freelancers/Constantly-asking-for-permission-to-share-screenshot-on-Gnome/m-p/1222388#M731300 |
On Mon, 16 Jan 2023, 17:44 Eric Masseran, ***@***.***> wrote:
I had the same issue. I probably said No once and it was saved when I was
on Gnome 43. I found a solution to switch the permission.
Here the script to execute:
import dbusbus = dbus.SessionBus()perm = bus.get_object('org.freedesktop.impl.portal.PermissionStore', '/org/freedesktop/impl/portal/PermissionStore')perm_iface = dbus.Interface(perm, dbus_interface='org.freedesktop.impl.portal.PermissionStore')
perm_iface.Lookup("screenshot", "screenshot")perm_iface.Set("screenshot", dbus.Boolean(True), "screenshot", {"": ["yes"]}, dbus.Byte(0x00))perm_iface.Lookup("screenshot", "screenshot")
I found the solution here:
https://community.upwork.com/t5/Freelancers/Constantly-asking-for-permission-to-share-screenshot-on-Gnome/m-p/1222388#M731300
—
Reply to this email directly, view it on GitHub
<#2868 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKNEBR4KSNKIYFVFNO5X5LWSV3HFANCNFSM56IFQHVA>
.
You are receiving this because you are subscribed to this to thread.
Is this the contrived obscure backend script alternative to a "Remember my
choice" checkbox that would clearly be an ideal solution/workaround for
this scenario or does Gnome only remember if you selected "Deny" and then
prompt for permission every time you want to share a screenshot?
I am not clear as to the specific "solution" in this case, I'll try to find
a moment to test this myself and report back.
Clearly either way, this is an issue with Gnome/Wayland rather than
Flameshot.
Message ID: ***@***.***>
… |
works! thank you |
How I fix it on fc38 Beta All works perfect |
Hi, please see: If the gnome test passes, maybe we can depend on it, or use the dbus path of this repo (for GNOME and KDE) edit: Well, it looks like I can't use it - it doesn't solve the problem with the above issues of issues, still using dbus |
This has nothing to do with Flameshot. It all depends on xdg portal of Gnome. It was pointed out that you can use the Flatpak command to adjust this permission: I'm not a Gnome user so I leave it to your own judgement and experience. |
death by a thousand cuts. Debian linux doesn't know how to use the SCREENSHOT key without confirmation from the user. |
this looks irrelevant to modern days |
@darkblaze69 Disagree Fedora 39, Wayland. Gnome 45.2 |
I'm using a modern stable version of Devuan with Mate desktop manager, and I had to write a script to call gnome-screenshot with special commands and specifying the screenshot / pictures folder for it, and call my script instead of gnome-screenshot, to suppress the user confimation window, so I think this is still a relevant issue. Windows 10/11 just knows, how to use the screenshot key on most keyboards. |
I use fedora 39 with gnome wayland and I can take screenshots without prompt with just a key combination. The issue is solved. |
So I had, as everyone in this thread, the same problem that I couldn't take screenshots anymore. At least not from the widget. From the terminal it worked without any issues via So @uacode recommended based on his experience to What still does not work is via shortcut key. I set up my key Under Nonetheless, I hope what I found out so far could others which come across into this issue, also thank @uacode for the inspiration? 🤷♂️ and for giving direction. TL;DR:Fix taking screenshot with the widget
InformationSystem Details Report
Flameshot
|
I can use Flameshot only when I run it from Gnome Software (not from Apps or start on startup) :) |
Never mind I can't use it anymore…again the same issue which we have all here… It does also not work with the flatpak version. There I can't even give screenshot permissions because there is no such entry... |
You may find this strange but i managed to take screenshot using shortcut. I use terminator as a terminal emulator and it has the ability to execute commands when opened. Simply create a custom shortcut with command: edit: image added |
Thanks a lot for the idea @redsfyre. Running Manjaro / Gnome, couldn't find any combination that worked installing from whatever source with whatever ENV set (haven't searched for ages but still), but it works with this command
Edit : I was actually annoyed by the gnome-terminal windows opening & being included in the screenshot itself. Tried to start it minimized or some sheganigan along those lines without success. And since I use Tilix most of the time anyway, , I switched to
|
For me it works here with Flatpak and PrtScrn keyboard button in Gnome. Command: Shortcut: |
I tried this, and it didn't work, sadly. I have the following log output in the terminal. ok@thinkpadx395:~$ flatpak run org.flameshot.Flameshot gui
Gtk-Message: 17:55:38.035: Failed to load module "canberra-gtk-module"
Gtk-Message: 17:55:38.035: Failed to load module "pk-gtk-module"
Gtk-Message: 17:55:38.036: Failed to load module "canberra-gtk-module"
Gtk-Message: 17:55:38.036: Failed to load module "pk-gtk-module"
qt.qpa.qgnomeplatform: Could not find color scheme ""
Qt: Session management error: Could not open network socket
flameshot: error: Unable to capture screen
flameshot: error: Unable to capture screen
flameshot: info: Screenshot aborted. |
Thanks @redsfyre I like to use the Sakura, so my command is like this.
|
Update Flatpak version: Does still not work! Update RPM version: Does only work with a custom shortcut, as @rgarrigue already mentioned it.
|
For Flatpak just run |
This worked flawlessly! Thank you @PolyMeilex! Now the flameshot logo has some overlay icon in the topbar, I guess a bug, but that's a thing for a new post! It's a bit unfortunate I can't set this permission via flatseal, but happy to see that you are working on it! 😊 🚀 |
Feature Description
This issue is to track updating Flameshot to use the new permission store that was merged into to xdg-desktop-portal: flatpak/xdg-desktop-portal#649 (comment)
This will allow users to take a screenshot without hitting the share button each time.
The text was updated successfully, but these errors were encountered: