flameshot-org / flameshot

Powerful yet simple to use screenshot software :desktop_computer: :camera_flash:
https://flameshot.org
GNU General Public License v3.0
24.22k stars 1.55k forks source link

Flameshot unable to capture screen when triggered through Gnome shortcut #3365

Open kekonn opened 9 months ago

kekonn commented 9 months ago

Flameshot Version

Flameshot v12.1.0 (-) Compiled with Qt 5.15.10

Installation Type

Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...)

Operating System type and version

Arch with kernel 6.5.4-273-tkg-bore

Description

When using a shortcut (Print screen) to run Flameshot I get "Unable to capture screen".

When I run the command from the shortcut in a terminal, it works.

Now both used to work fine before, but stopped working after my daily updates sometime this week. The normal Gnome screenshot program still works.

If you can tell me where I should look for further logs, please do, so I can upload them.

Steps to reproduce

In Arch running Gnome:

  1. Bind screenshot a region key to printscreen and set it to /usr/bin/flameshot gui
  2. Use key to trigger flameshot
  3. Get Unable to capture screen error

Screenshots or screen recordings

image (Shortcut settings)

System Information

System:
  Host: tuxgamer Kernel: 6.5.4-273-tkg-bore arch: x86_64 bits: 64
    Desktop: GNOME v: 44.5 Distro: Arch Linux
Graphics:
  Device-1: AMD Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT]
    driver: amdgpu v: kernel
  Device-2: Logitech Brio 500 driver: hid-generic,usbhid,uvcvideo type: USB
  Device-3: Chicony USB2.0 FHD UVC WebCam driver: uvcvideo type: USB
  Display: wayland server: X.org v: 1.21.1.8 with: Xwayland v: 23.2.1
    compositor: gnome-shell driver: X: loaded: modesetting dri: radeonsi
    gpu: amdgpu resolution: 5120x1440~60Hz
  API: EGL v: 1.5 drivers: kms_swrast,radeonsi,swrast
    platforms: gbm,wayland,x11,surfaceless,device
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 23.2.1-arch1.2
    renderer: AMD Radeon RX 6700 XT (navi22 LLVM 16.0.6 DRM 3.54
    6.5.4-273-tkg-bore)
nickuc commented 9 months ago

I have exactly the same problem. I use Flameshot on Arch and it stopped working after my routine updates.

mrwormhole commented 9 months ago

does it launch or log anything when you do this command on the terminal? flameshot gui

I am on arch too, 6.5.5-arch1-1 it does work on my side, however due to gnome experimental fractional scaling, the window does open in the wrong places and block the places that I am trying to screenshot

I have a feeling that this could be a wayland issue

OK, that's interesting, actually I have stopped using the AUR flameshot-git, I have installed flameshot through official arch repos (they didn't have this before) and it started working without fractional scaling issue or any other issues. There is a warning that you should be solving for consistent usage, please set QT_QPA_PLATFORM=wayland

image

kekonn commented 9 months ago

does it launch or log anything when you do this command on the terminal? flameshot gui

It does.

I am on arch too, 6.5.5-arch1-1 it does work on my side, however due to gnome experimental fractional scaling, the window does open in the wrong places and block the places that I am trying to screenshot

I have a feeling that this could be a wayland issue

OK, that's interesting, actually I have stopped using the AUR flameshot-git, I have installed flameshot through official arch repos (they didn't have this before) and it started working without fractional scaling issue or any other issues. There is a warning that you should be solving for consistent usage, please set QT_QPA_PLATFORM=wayland

image

I want to point out that flameshot gui works from the terminal wether QT_QPA_PLATFORM is set or not. It's when I use the tray icon or through a gnome shortcut that there is an issue.

I am starting to suspect that something in my Gnome desktop updated and broke an assumption of Flameshot. Is there a way to enable debug logging to get more info about the error Flameshot produces?

mrwormhole commented 9 months ago

can you delete the package that you installed from AUR and install the official one? (extra/flameshot)

kekonn commented 9 months ago

I did not install through the AUR: image

mmahmoudian commented 9 months ago

Thanks for the issue and also thank you @mrwormhole for the comments. I think I should mention few points:

  1. the AUR package flameshot-git is actually maintained by us. Therefore it is "official", but it is always compiling aganst the HEAD of the master branch of this git repo, therefore you should consider it as beta, and not stable release.
  2. At the moment we have regression bug in the HEAD of master that makes the flameshot gui to cause segfault. We are aware of it and it is getting worked on.
  3. Gnome constantly change their API, which always put devs in disadvantage. That said, this issue might not be Gnome-specific.

I am not a Gnome user, so I cannot right-away confirm this. I will try to reproduce the issue in a VM later and see if it is reproducible in a clean-install VM. in the meantime, perhaps you can use the AppImage while we are investigating :)

kekonn commented 9 months ago

Is there anything I can do to help, such as gather debug logs? I tried to look in the settings, but couldn't find anything about debug logging.

mmahmoudian commented 9 months ago

@kekonn Thanks, but unfortunately we do not have extensive log reporting. Flameshot was very stable until Gnome Wayland hit the market and then many things went wrong and we are having hard time to keep up. The best help you can do is to install Arch + Gnome Wayland on a VM (no other software), and then install Flameshot and see if flameshot gui works there or not. I personally don't have access to a computer with enough empty disk space to try to reproduce this.

Also, please edit your original post and change the Installation type to Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...) because you have installed Flameshot from the extra repo of Arch rather than AUR.

kekonn commented 9 months ago

Also, please edit your original post and change the Installation type to Linux, MacOS, or Windows Package manager (apt, pacman, eopkg, choco, brew, ...) because you have installed Flameshot from the extra repo of Arch rather than AUR.

Done! I also want to mention that running flameshot gui from the terminal does work for me. The issue is that that is the only way to make it work.

The Gnome shortcut and tray icon method are the ones that broke sometime in the last week. I will also try to see if the appimage improves the situation.

EDIT: The AppImage throws the following error and does not work at all:

~/Applications 
❯ ./Flameshot-12.1.0.x86_64_10ab227368a704f2d66cded7a7aa8248.AppImage 
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
execv error: No such file or directory
emystein commented 9 months ago

Same as @kekonn, it works for me from the terminal. Using a shortcut from Gnome, I see in the system logs:

oct 09 10:26:55 t14 flameshot[2895]: Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
oct 09 10:26:55 t14 systemd[1272]: Started Application launched by gsd-media-keys.
oct 09 10:26:55 t14 xdg-desktop-por[1889]: Failed to show access dialog: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Only the focused app is allowed to show a system access dialog
oct 09 10:26:55 t14 flameshot[2895]: flameshot: error: Unable to capture screen
oct 09 10:26:55 t14 flameshot[2895]: flameshot: error: Unable to capture screen
oct 09 10:26:55 t14 flameshot[2895]: flameshot: info: Screenshot aborted.

Worth to mention that Flameshot was working just fine as of version 12.0.1-2 and stopped working in 12.0.1-3.

friimaind commented 9 months ago

Same here. Launching via terminal works as expected (I only have a warning but I don't know if he did it before)

flameshot gui
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.

Using Gnome shortcuts (PRINT with /usr/bin/flameshot gui) gives me "Unable to capture screen"

Flameshot v12.1.0 (001726a5)
Compiled with Qt 5.15.5

OS: EndeavourOS
Kernel: x86_64 Linux 6.5.5-arch1-1
DE: GNOME 44.4
WM: Mutter
pschichtel commented 9 months ago

https://github.com/search?q=repo%3Aflameshot-org%2Fflameshot+GDBus.Error%3Aorg.freedesktop.DBus.Error.AccessDenied&type=issues

aren't these all related?

qomosoloto commented 9 months ago

Same issue came to me after upgrading my manjaro(gnome DE) today, only terminal command or right click on tray icon worked!

mmahmoudian commented 9 months ago

@qomosoloto

only terminal command or right click on tray icon worked!

Then what doesn't work? These two are the only two ways you can trigger Flameshot.

kekonn commented 9 months ago

For me only the terminal method works, but the method that stopped working for all of us is triggering it through Gnome Shortcuts.

ghost commented 9 months ago

Reproduced on latest Arch with GNOME.

flameshot gui from gnome-terminal works fine, but the exact same command doesn't work from the launcher (i.e. Alt+F2).

ghost commented 9 months ago

Ah wait, I should've installed the AUR version, previous comment is for flameshot from the official extra repo.

I'll test with the AUR version when I get the chance.

ghost commented 9 months ago

Same problem with flameshot-git from AUR.

pschichtel commented 9 months ago

after some testing I found: https://github.com/flatpak/xdg-desktop-portal/issues/1070

I quick workaround is: copy your /usr/share/applications/org.flameshot.Flameshot.desktop file to ~/.local/share/applications/flameshot.desktop. xdg-desktop-portal is than able to properly find the application and asks for permissions and/or allows the screenshot. You can delete the new desktop file right after you granted permissions.

Alternatively a downgrade of the xdg-desktop-portal binary might also work.

@mmahmoudian From that issue, this summary comment seems relevant to you/flameshot: https://github.com/flatpak/xdg-desktop-portal/issues/1070

specifically:

And lastly, the error message you're seeing is on purpose. Flameshot needs to create a window before using the portal. You should also open an issue on their bug tracker.

darkblaze69 commented 9 months ago

I quick workaround is: copy your /usr/share/applications/org.flameshot.Flameshot.desktop file to ~/.local/share/applications/flameshot.desktop.

For me this doesn't help, also tried on the new user.

We can debug some via xdg-desktop-portal --replace --verbose In XDP 1.6.0 it was indeed its bug which allowed flameshot to run to permission request and so forth:

XDP: Assigning app ID "" to pid 55633 which has unit "app-gnome-flameshot-55633.scope"
XDP: Handle Screenshot
XDP: No 'screenshot' permissions found: No entry for screenshot
XDP: Calling Screenshot with interactive=0
XDP: sending response: 0

The ID is empty because of XDP bug, it says 'no permission found' though request was shown and I allowed it and all good.

Since XDP 1.7.0 the matching bug was fixed, now it's able to match the ID, but the permission request isn't called:

XDP: Assigning app ID "flameshot" to pid 64571 which has unit "app-gnome-flameshot-64571.scope"
XDP: Handle Screenshot
XDP: No permissions stored for: screenshot screenshot, app flameshot

(/usr/lib/xdg-desktop-portal:64541): xdg-desktop-portal-WARNING **: 02:03:49.117: Failed to show access dialog: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Only the focused app is allowed to show a system access dialog
XDP: sending response: 2

So just by guessing based on the output the probable solution would be to create some small window on flameshot gui ?

pschichtel commented 9 months ago

yeah I just repeated it on a different system. You actually have to start the application and take a screenshot while the configuration window is focused. It should then ask for permissions.

Tobleh commented 9 months ago

@qomosoloto

only terminal command or right click on tray icon worked!

Then what doesn't work? These two are the only two ways you can trigger Flameshot.

You can also trigger flameshot by using a custom keyboard shortcut to activate that terminal command, i.e. setting flameshot gui to activate when you press the Print Screen key or a key combination like Ctrl + Print Screen. The problem that multiple people (including me) are having is that we are not able to trigger Flameshot using a keyboard shortcut set via GNOME settings.

Cyber-SiKu commented 9 months ago

I have exactly the same problem.but in terminal is ok.

gianmarcotoso commented 9 months ago

yeah I just repeated it on a different system. You actually have to start the application and take a screenshot while the configuration window is focused. It should then ask for permissions.

This works for me, but only when taking screenshots via the tray icon. So to recap:

mmahmoudian commented 9 months ago

@gianmarcotoso

  • flameshot gui from the terminal: works
  • ...
  • Shortcut mapped to flameshot gui: does not work

This is weird. Isn't the Gnome shortcut suppose to start a shell and run the command (in this case flameshot gui) there?

What happens if you change the Gnome shortcut to bash -c "flameshot gui"and see if that changes anything?

gianmarcotoso commented 9 months ago

@mmahmoudian it's extremely weird.

Isn't the Gnome shortcut suppose to start a shell and run the command (in this case flameshot gui) there? What happens if you change the Gnome shortcut to bash -c "flameshot gui" and see if that changes anything?

I had the same intuition and actually tried that, same result: "Unable to capture screen". I've also tried to modify the flameshot.desktop file, setting the launch command to flameshot gui, and then mapping the shortcut to gtk-launch flameshot.desktop: same result.

I suspect it has something to do with how Gnome handles permission, but I can't really be sure as I can't find any logs anywhere. Do you have any suggestion as to how this can be debugged?

Bitals commented 9 months ago

Worth to mention that Flameshot was working just fine as of version 12.0.1-2 and stopped working in 12.0.1-3.

Unrelated, tried downgrading just for the sake of it.

Tealk commented 9 months ago

What happens if you change the Gnome shortcut to bash -c "flameshot gui"and see if that changes anything?

unfortunately does not work for me

fabiojb commented 9 months ago

Using argos script on Gnome as a workaround:

filename: ~/.config/argos/flameshot.sh

#!/usr/bin/env bash

echo "flameshot"
echo "---"
echo "take screenshot | bash='flameshot gui' terminal=false"

This creates a shortcut for flameshot on Gnome's top bar. Invoking flameshot from this shortcut works normally

darkblaze69 commented 9 months ago

using wrapper like /usr/local/bin/flameshot-gui allows to use as shortcut:

#!/bin/bash
/usr/bin/flameshot gui

But paste after screenshoting doesn't work.

hedgieinsocks commented 9 months ago

thank you for the wrapper idea, made it work via https://extensions.gnome.org/extension/5874/launcher/

luiz734 commented 9 months ago

I am experiencing the same problem. I have noticed that I can run flameshot using Gnome Console (kgx), but I can't with Kitty or the shortcut.

Arch, Gnome 45, kernel 6.1.56-1-lts.

sean-clayton commented 9 months ago

I'm using Arch with the extra/flameshot package on Gnome. Here's the output of QT_DEBUG_PLUGINS=1 flameshot gui for me:

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqeglfs.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqeglfs.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "eglfs"
        ]
    },
    "archreq": 0,
    "className": "QEglFSIntegrationPlugin",
    "debug": false,
    "version": 331520
}

Got keys from plugin meta data ("eglfs")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqlinuxfb.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqlinuxfb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "linuxfb"
        ]
    },
    "archreq": 0,
    "className": "QLinuxFbIntegrationPlugin",
    "debug": false,
    "version": 331520
}

Got keys from plugin meta data ("linuxfb")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqminimal.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqminimal.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "minimal"
        ]
    },
    "archreq": 0,
    "className": "QMinimalIntegrationPlugin",
    "debug": false,
    "version": 331520
}

Got keys from plugin meta data ("minimal")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqminimalegl.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqminimalegl.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "minimalegl"
        ]
    },
    "archreq": 0,
    "className": "QMinimalEglIntegrationPlugin",
    "debug": false,
    "version": 331520
}

Got keys from plugin meta data ("minimalegl")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqoffscreen.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqoffscreen.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "offscreen"
        ]
    },
    "archreq": 0,
    "className": "QOffscreenIntegrationPlugin",
    "debug": false,
    "version": 331520
}

Got keys from plugin meta data ("offscreen")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqvnc.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqvnc.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "vnc"
        ]
    },
    "archreq": 0,
    "className": "QVncIntegrationPlugin",
    "debug": false,
    "version": 331520
}

Got keys from plugin meta data ("vnc")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqwayland-egl.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqwayland-egl.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland-egl"
        ]
    },
    "archreq": 0,
    "className": "QWaylandEglPlatformIntegrationPlugin",
    "debug": false,
    "version": 331520
}

Got keys from plugin meta data ("wayland-egl")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqwayland-generic.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqwayland-generic.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland"
        ]
    },
    "archreq": 0,
    "className": "QWaylandIntegrationPlugin",
    "debug": false,
    "version": 331520
}

Got keys from plugin meta data ("wayland")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqwayland-xcomposite-egl.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqwayland-xcomposite-egl.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland-xcomposite-egl"
        ]
    },
    "archreq": 0,
    "className": "QWaylandXCompositeEglPlatformIntegrationPlugin",
    "debug": false,
    "version": 331520
}

Got keys from plugin meta data ("wayland-xcomposite-egl")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqwayland-xcomposite-glx.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqwayland-xcomposite-glx.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland-xcomposite-glx"
        ]
    },
    "archreq": 0,
    "className": "QWaylandXCompositeGlxPlatformIntegrationPlugin",
    "debug": false,
    "version": 331520
}

Got keys from plugin meta data ("wayland-xcomposite-glx")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/qt/plugins/platforms/libqxcb.so"
Found metadata in lib /usr/lib/qt/plugins/platforms/libqxcb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "xcb"
        ]
    },
    "archreq": 0,
    "className": "QXcbIntegrationPlugin",
    "debug": false,
    "version": 331520
}

Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...
loaded library "/usr/lib/qt/plugins/platforms/libqxcb.so"
Authorization required, but no authorization protocol specified

qt.qpa.xcb: could not connect to display :0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Hopefully this helps :sweat_smile:

gaginsgagins commented 9 months ago

Yes. I confirm. Bug after the last update. Launching via the terminal works. Manjaro. Through the gnome shortcut does not work.

ottosch commented 9 months ago

Same problem on Arch Linux, Gnome 45, Wayland.

andremartinssw commented 9 months ago

Workaround

Replace flameshot gui with gnome-terminal -- bash -c 'flameshot gui' &

Tealk commented 9 months ago

if you already use the new gnome console:

kgx -e 'flameshot gui'

ciro-mota commented 9 months ago

Me too.. Same problem on Arch Linux - Gnome 45 - Wayland.

Vringe commented 9 months ago

Same here, Arch Linux, Gnome 45, Wayland

ciro-mota commented 9 months ago

Maybe the problem with Flameshot is some consequence of a problem with GNOME, since I also have a problem with prints with the Ksnip tool.

https://github.com/ksnip/ksnip/issues/995

TahaCoder43 commented 9 months ago

@qomosoloto

only terminal command or right click on tray icon worked!

Then what doesn't work? These two are the only two ways you can trigger Flameshot.

  1. It doesn't run if ran through the Alt+F2 command runner
  2. it doesn't run if another app runs it

There is an app called flypie which you can configure to run custom commands, but when flameshot is ran through it, it fails

mmahmoudian commented 9 months ago

Just for the record, this looks pike the duplicate of #3326 but I'll keep it open because of good discussions

hydrandt commented 9 months ago

I had the same problem. Ubuntu 23.10, Gnome, Wayland. I could use flameshot when started from the terminal (flameshot gui) and also when taking screenshot from the tray icon. But couldn't use it from a keyboard shortcut.

Found a working solution here: https://github.com/flatpak/xdg-desktop-portal/issues/1070#issuecomment-1771302632

pschichtel commented 9 months ago

FYI I have tested my previously mentioned workaround on 4 different arch systems, all successful.

kevinbburns commented 9 months ago

using wrapper like /usr/local/bin/flameshot-gui allows to use as shortcut:

#!/bin/bash
/usr/bin/flameshot gui

But paste after screenshoting doesn't work.

This worked like a charm; I already have a folder dedicated to all my "hacks," so another script wasn't a big deal. On Fedora 39, at least, to get the copy and paste to work, I added a "&" at the end of the command, which worked as expected.

kelly6 commented 9 months ago

Same here, Manjaro, Gnome 45, Wayland

I have tried all the solutions above, but none of them worked

(gnome-terminal -- bash -c 'flameshot gui' & words ok, but there is always an annoying window popping up when I take screenshots. ).

I believe this is a permission issue with xdg-desktop-portal, but I am not familiar with it. I work this out with an ugly solution.

run this python script in backgroup

import os
import pyinotify

class event_handler(pyinotify.ProcessEvent):
    def process_IN_OPEN(self, event):
        os.system("flameshot gui")

wm = pyinotify.WatchManager()
wm.add_watch("/tmp/flameshot", pyinotify.ALL_EVENTS)
handler = event_handler()
notifier = pyinotify.Notifier(wm, handler)
notifier.loop()

then add touch /tmp/flameshot to shortcut.

It works fine.

eitch commented 9 months ago

I have the same issue, using @darkblaze69 solution worked nicely. Copy paste into e.g. an e-mail worked as expected.

mmahmoudian commented 9 months ago

Try the solution proposed here for Gnome shortcus:

https://github.com/flameshot-org/flameshot/issues/3326#issuecomment-1789267986

eitch commented 9 months ago

If this helps any, i just realized that my Ubuntu 23.10 version is running Wayland by default.

VeldoraTheDragon commented 8 months ago

using wrapper like /usr/local/bin/flameshot-gui allows to use as shortcut:

#!/bin/bash
/usr/bin/flameshot gui

But paste after screenshoting doesn't work.

This worked like a charm; I already have a folder dedicated to all my "hacks," so another script wasn't a big deal. On Fedora 39, at least, to get the copy and paste to work, I added a "&" at the end of the command, which worked as expected.

The wrapper script also works on Arch Linux Gnome 45 / Wayland.

@flameshot-devs : Have you come closer to a possible solution to fix this issue? A workaround is alright, but not a permanent solution.