flameshot-org / flameshot

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

Unable to capture screen and Screenshot aborted using Gnome shortcut on Arch Linux #3446

Closed Pole11 closed 9 months ago

Pole11 commented 9 months ago

Flameshot Version

Flameshot v12.1.0 (-) Compiled with Qt 5.15.10

Installation Type

User repository (AUR)

Operating System type and version

ArchLinux 6.6.8-arch1-1

Description

When I open a terminal window and write flameshot gui everything works fine. image This is a screenshot I just took with this method.

But when I go to Gnome Settings > Keyboard > View and Customize Shortcuts > Custom Shortcuts and I set the following shortcut image i get the following errors image image

There is a workaround that is assigning to the Print key the following command: gnome-terminal -e 'flameshot gui'. Sometimes it works fine because the terminal window appears but is not displayed in the screenshot but sometimes you can see the terminal window appearing. This for example is the portal animation I have before every window appears (in this case is the gnome-terminal window appearing), and sometimes it is visible because the screenshot a little bit too late, but sometimes it is fast enough to not be included in the screenshot image

I hope this problem can be fixed so there is a cleaner way to create the keyboard shortcut.

Nice program btw.

Steps to reproduce

Assuming flameshot is installed and is working from a terminal window. AND assuming that the current DE is Gnome.

  1. open Gnome Settings > Keyboard > View and Customize Shortcuts > Custom Shortcuts
  2. create a shortcut, assigning the command flameshot gui
  3. press the key combination assigned to the shortcut created on step 2

Screenshots or screen recordings

With the command gnome-terminal --command 'flameshot gui' as gnome shortcut

When it is not fast enough to take the screenshot and it also captures the animation. image When it is fast enough image Screencast_26_12_2023_12:04:38.webm

With the command flameshot gui as gnome shortcut

The error Screencast_26_12_2023_12:08:09.webm

System Information

  1. ArchLinux 6.6.8-arch1-1
  2. eDP-1, the screen of my laptop (1080p)
  3. Yes, I am using Linux. My DE is Gnome on Wayland
kabessao commented 9 months ago

can confirm, I'm having the same error, I'm on gnome 45.2. Additionally, trying to summon flameshot gui from the alt+f2 command prompt has the same result.

kabessao commented 9 months ago

idk exactly what I did to "fix it", but now it's working, sort of.

Basically I was trying to get a work around to make it work, and that's when I had the idea of calling a bash script instead of flameshot with the shortcut, and at one point I made the script dump it's PATH content, which I quickly saw it was different from my usual PATH, so I decided to dump my usual PATH somewhere and in the script set that as the PATH and then call flameshot, and surprisingly it worked! I removed the part where it sets the PATH and it kept working, so I restarted my machine to make sure and it still works somehow.

So, for now, to be able to use flameshot I'm using a script shell to do it, because directly calling it from either the shortcut command or alt+f2 still does not work.

Pole11 commented 9 months ago

As previously said, creating a script that executes the command flameshot gui and binding it to the keyboard shortcut solves the problem.

rbudiharso commented 7 months ago

Can confirm this, simply create shellscript with this content, make it executable and assign it to a keyboard shotcut works on Fedora 39 (GNOME on wayland)

#!/bin/sh
/usr/bin/flameshot gui