Flameshot not working in sway (typing "flameshot gui" hangs in the terminal)


I tried links like this one: flameshot/Sway and wlroots support.md at master · flameshot-org/flameshot · GitHub

But it didn't work. When I type flameshot gui in the terminal, it just hangs. Any solution?
I also looked at this How To Use Flameshot Screenshots On Wlroots & Sway - YouTube but we're using fish in garuda

It won't effect the script.

PS : The actual issue is here is that flameshot doesn't support wayland by default. And sway uses wayland. So, you have to do some extra work manually to use flameshot.

There is no roll of shell here....(except making scripts off course)

1 Like

Ah, I see. flameshot gui. Weird.
Better ask at Discussions · flameshot-org/flameshot · GitHub though, there you will find users familiar with flameshot.
I suspect it has problems with Wayland. I use grimshot, I think it was installed by default.
garuda-inxi please nevertheless.

I noticed that when I finally killall flameshot in another terminal, these errors are printed:

flameshot: error: Unable to capture screen
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()

Not sure what it means though.

1 Like

oh boi : ' (

okay thanks. I posted my issue there just now.

I don’t think flame shot has wayland support yet. It works well on x11 though

I was able to get it working, although it does require downgrading xdg-desktop-portal from 1.15.0-1 to 1.14.6-1, which is not noted in the referenced documentation. :face_with_monocle:

Ensure that environment variables are set properly. If your distro does not set them automatically, use a launch script to export XDG_CURRENT_DESKTOP=sway before Sway is launched.

:point_up: There are a number of ways to do this, but if you are still using greetd (the default login manager) then the simplest way is probably to set up a wrapper script as suggested by the greetd wiki.

Create the script:

micro /usr/local/bin/sway-run

I just pasted the whole window right out of the Flameshot Github page linked above:

export SDL_VIDEODRIVER=wayland
export QT_QPA_PLATFORM=wayland
exec sway

Don't forget to make it executable.

sudo chmod +x /usr/local/bin/sway-run

Next, add it to the greetd config.

micro /etc/greetd/config.toml

On the "command =" line, change "sway" to "sway-run" (the script you just made):

command = "tuigreet -r --cmd sway-run"

:point_up: Yours might look a little different than mine because I changed my greeter at some point. The important thing is to change "sway" to "sway-run"--the rest of the line you can leave as-is.

Add the stuff for systemd and dbus to your config:

micro .config/sway/config
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
exec hash dbus-update-activation-environment 2>/dev/null && \
     dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK

That's about it for what the documentation suggests, but it still wasn't working. I poked around for a bit searching off of debug clues from executing flameshot gui while the dbus-monitor --session sender=org.freedesktop.portal.Desktop destination=org.freedesktop.portal.Desktop line was running and somehow wound up on this bug report from August: flameshot gui from cli does nothing. dbus error UnknownMethod: "No such interface “org.freedesktop.portal.Screenshot” · Issue #2872 · flameshot-org/flameshot · GitHub

Multiple people in the thread mentioned they were able to get it working after downgrading xdg-desktop-portal from 1.15.0-1 to 1.14.6-1 so I gave it a shot.

sudo pacman -U file:///var/cache/pacman/pkg/xdg-desktop-portal-1.14.6-1-x86_64.pkg.tar.zst

It works! :tada:

Obviously if you don't have the 1.14.6-1 version in your cache (mine is timestamped August 2nd), you'll have to rummage around in the Arch Linux Archive and install it that way.

Don't forget to add IgnorePkg = xdg-desktop-portal to your pacman.conf until it gets straightened out. Happy screenshotting! :camera_flash:


Btw, see here: "Unable to capture screen" on KDE Wayland · Issue #2880 · flameshot-org/flameshot · GitHub it seems to be the same problem.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.