Can't use flameshot on sway wm

Hello my friends! Me again, I want to ask another question;

I’m using sway and I want to use flameshot for screenshot, then I see this: https://github.com/flameshot-org/flameshot/blob/master/docs/Sway%20and%20wlroots%20support.md

so I edit ~/.profile as

#!/bin/bash
export SDL_VIDEODRIVER=wayland
export _JAVA_AWT_WM_NONREPARENTING=1
export QT_QPA_PLATFORM=wayland
export XDG_CURRENT_DESKTOP=sway
export XDG_SESSION_DESKTOP=sway
exec sway

and add to ~/.config/sway/config.d/autostart_applications this:

# GTK3 applications take a long time to start
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

but still flameshot giving an error like:

[vokhirion@canavar ~]$ flameshot 
flameshot: error: Unable to capture screen
flameshot: error: Unable to capture screen
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()

Where did I do wrong?

Did you install the required packages?

xdg-desktop-portal, xdg-desktop-portal-wlr and grim

yes I installed them first

try reading this

as this link said, but xdg-desktop-portal already installed and I installed xdg-desktop-portal-kde too now, but unfortunately nothing changed.

Works for me. This is what I have:

#!/bin/bash
export SDL_VIDEODRIVER=wayland
export _JAVA_AWT_WM_NONREPARENTING=1
#export QT_QPA_PLATFORM=wayland
export WLR_NO_HARDWARE_CURSORS=1
export XDG_CURRENT_DESKTOP=sway
export XDG_SESSION_DESKTOP=sway
export MOZ_WAYLAND=1
export MOZ_ENABLE_WAYLAND=1
export QT_AUTO_SCREEN_SCALE_FACTOR=1
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
export GDK_BACKEND=wayland

export __GL_GSYNC_ALLOWED=0
export __GL_VRR_ALLOWED=0
export WLR_DRM_NO_ATOMIC=1
export GBM_BACKEND=nvidia-drm
export __GLX_VENDOR_LIBRARY_NAME=nvidia

exec sway --unsupported-gpu

You should remove that. Having more than one of these installed can cause issues sometimes.

I copy paste it to .profile after that I reload sway with super+Shift+c but nothing changed

ok I uninstalled

Perhaps you have already done this but maybe reboot? I do not know how .profile works but always worth a try!

Unfortunately…

1 Like

super+shift+c reloads the config only, to reload .profile will take a log out/in or reboot.

How are you launching flameshot?

I have it in a startup script which I use in other WM’s.

I tried to add it shortcuts as flameshot gui but didnt work, so I wanted to see error details and now I’m testing it with using terminal command flameshot, its opening but doesnt take screenshots and not giving an error before quitting.

And it is not working for me either! It was working (honest), the icon is in the tray, but it just hangs.

2022-08-25T18:39:57,331157296+01:00

Taken with grimshot :frowning:

sorry :frowning: did u try something or is it suddenly stop working? Maybe need a downgrade, what do u think?

Dunno, running git versions as I was trying to get nVidia to work, not even sure where to start debugging this.

I still couldnt fix it… :frowning: