Ok I have a working solution.
The process of opening flameshot config and taking a screenshot didn’t end up working for me. The prompt never showed. I threw claude at the issue and got it working. Then I also ran into an issue with copying to clipboard which claude found a solution for as well. These were a bit over my head so not sure how reasonable this fix is, but it works. Here is a summary:
Fixing Flameshot on GNOME Wayland: Screenshot Permission + Clipboard
Two issues and their fixes for Flameshot on GNOME Wayland (tested with Flameshot 13.3.0, GNOME Shell 49, NixOS).
Issue 1: “Unable to capture screen”
Symptom: Pressing a keyboard shortcut to launch Flameshot fails with:
Failed to show access dialog: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied:
Only the focused app is allowed to show a system access dialog
Root cause: An app_id mismatch in the XDG permission store. When gsd-media-keys launches a custom keybinding command, it creates a systemd scope based on the binary name — e.g. app-gnome-flameshot-gui-12345.scope. The portal extracts the app_id flameshot-gui from this. But the .desktop file registers as org.flameshot.Flameshot, so even if you’ve granted permission for org.flameshot.Flameshot, the portal doesn’t find a match for flameshot-gui. It tries to show an “Allow screenshots?” dialog, which GNOME blocks because the app launched in the background doesn’t have focus.
How to find your app_id: Trigger your keybinding, then run:
systemctl --user list-units --type=scope | grep flameshot
The scope name app-gnome-<APP_ID>-.scope reveals what the portal actually sees.
Fix: Grant the screenshot permission for the correct app_id:
dbus-send --session --print-reply=literal \
--dest=org.freedesktop.impl.portal.PermissionStore \
/org/freedesktop/impl/portal/PermissionStore \
org.freedesktop.impl.portal.PermissionStore.SetPermission \
string:'screenshot' boolean:true string:'screenshot' \
string:'flameshot-gui' array:string:'yes'
This takes effect immediately (no reboot). The permission persists in ~/.local/share/flatpak/db/screenshot across reboots.
Issue 2: Clipboard doesn’t work
Symptom: After taking a screenshot and pressing Ctrl+C in Flameshot’s annotation UI, nothing ends up on the clipboard. Pasting into other apps does nothing.
Root cause: Flameshot’s built-in clipboard copy is broken on Wayland. This is true under both XWayland (Qt’s default on GNOME) and native Wayland (QT_QPA_PLATFORM=wayland). Confirmed still broken in 13.3.0.
Fix: Use --raw to pipe the screenshot through wl-copy instead. The --raw flag still shows the full annotation UI — it just outputs the final PNG to stdout when you’re done:
flameshot gui --raw | wl-copy
NixOS Wrapper (both fixes combined)
Here’s the wrapper script approach I use in my NixOS config. The dbus-send grants the portal permission on every invocation so it self-heals if the permission store is ever cleared:
let
grantScreenshotPermission = appId: ''
${pkgs.dbus}/bin/dbus-send --session --print-reply=literal \
--dest=org.freedesktop.impl.portal.PermissionStore \
/org/freedesktop/impl/portal/PermissionStore \
org.freedesktop.impl.portal.PermissionStore.SetPermission \
string:'screenshot' boolean:true string:'screenshot' \
string:'${appId}' array:string:'yes' 2>/dev/null || true
'';
flameshotGui = pkgs.writeShellScriptBin "flameshot-gui" ''
${grantScreenshotPermission "flameshot-gui"}
${pkgs.flameshot}/bin/flameshot gui --raw | ${pkgs.wl-clipboard}/bin/wl-copy
'';
in
{
# Bind to a custom keybinding via dconf
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
name = "Flameshot";
command = "${flameshotGui}/bin/flameshot-gui";
binding = "<Shift><Control>4";
};
}
This likely affects any app launched via a GNOME custom keybinding where the binary name doesn’t match the .desktop file’s app_id.