Skip to content

Instantly share code, notes, and snippets.

@linuxkathirvel
Last active November 23, 2024 09:28
Show Gist options
  • Save linuxkathirvel/5e8bb416f487b4b47a97daa42288502f to your computer and use it in GitHub Desktop.
Save linuxkathirvel/5e8bb416f487b4b47a97daa42288502f to your computer and use it in GitHub Desktop.
How to assign PrtScr(Print Screen) key to Flameshot screenshot tool in Gnome 3?

How to assign PrtScr(Print Screen) key to Flameshot screenshot tool in Gnome 3?

  1. Goto Keyboard settings and click 'Save a screenshot to Pictures' under 'Screenshots' section.
  2. Press 'Backspace' key delete 'PrtScr' key shortcut and press 'Set' button
  3. Press '+'(Plust) icon in the 'Custom Shortcuts' in the same window
  4. Enter 'Flameshot' in 'Name' field , 'flameshot gui' in 'Command' field, and click 'Set Shortcut' button and press 'PrtScr' button in the keyboard and close the dialog box 5.That's it. If you press 'PrtScr' key, the Flameshot selection area screen will appear.
@AndrewTtofi
Copy link

works perfectly thanks!

@userdehghani
Copy link

helpful 👍

@mauriciogracia
Copy link

mauriciogracia commented Jun 6, 2022

I'm unable to follow the step 3, I don't see any Custom Shortcuts or Plus button, I'm using Ubuntu 20.04

  • Under Settings got o Keyboard Shortcuts search for 'Save a screenshot to Pictures' from the list on the right, after step 2 it looks like this
    image

@heavymevi
Copy link

Than you very much !

@userdehghani
Copy link

userdehghani commented Jun 9, 2022

I'm unable to follow the step 3, I don't see any Custom Shortcuts or Plus button, I'm using Ubuntu 20.04

  • leave the Save a screenshot to Pictures on disabled mode.
  • you should see plus button at the end of Keyboard Shortcuts list.

@mauriciogracia

@michaelbanzato
Copy link

I'm unable to follow the step 3, I don't see any Custom Shortcuts or Plus button, I'm using Ubuntu 20.04

  • Under Settings got o Keyboard Shortcuts search for 'Save a screenshot to Pictures' from the list on the right, after step 2 it looks like this
    image

In the bottom!
image

@RogerioDoCarmo
Copy link

It solved my problem. Thank you.

@mauriciogracia
Copy link

mauriciogracia commented Aug 11, 2022

Thanks for your comments, It has worked fine.

The instructions should read
Step 3. Go to the bottom of the Keyboard Shorts and click the "+" sign

"Custom shortcuts" does not exists until you add your first one

@sergiomarchiori
Copy link

It's so nice to have a short instruction that works perfectly. Thank you!

@soyayaos
Copy link

You also can use flameshot screen -p /path/to/folder/ to automatically save a screenshot of the active desktop.

Copy link

ghost commented Oct 29, 2022

If you installed Flameshot through Flatpak, the command should be set to flatpak run org.flameshot.Flameshot gui in order to make it work. Have fun with your superior screenshot tool 🎉

@adriasir123
Copy link

It works, thanks!
I'm using Debian 11 with GNOME Shell 3.38.6

@Octopusmode
Copy link

Perfect, been looking for a nice Linux alternative to Lightshot in windows. This is better!

Try WIN + Shift + S

@LK-Hemant
Copy link

not working for me

@LK-Hemant
Copy link

image
shows this error message when i types prt scn button.
image

@githb123
Copy link

githb123 commented Apr 27, 2023

@LK-Hemant
Try putting the full path into the command field followed by the "gui". In a shell run

$ which flameshot
/your/path/to/flameshot #copy paste this and also add "gui" at the end.

BTW on Fedora 36 (probably the newer too) there is no "'Save a screenshot to Pictures" so just remove the Print binding from wherever it's assigned. Then back out one level up and go to "Custom Shortcuts" to add the new shortcut.

@hugocomh
Copy link

Works like a charm on Ubuntu 23.04.. thanks!

@greglixandrao
Copy link

flatpak run org.flameshot.Flameshot gui

Thak you very much.. Works perfectly

@greglixandrao
Copy link

Hello, @nmcusa I just hit ctrl+c after select the area, out the elements (arrow, retangle..) and the picture is sand to clipboard

@The-Hashad
Copy link

Thank you.

@fjpaniagua
Copy link

A small step for mankind... Thanks you very much!

@George33331
Copy link

If you installed Flameshot through Flatpak, the command should be set to flatpak run org.flameshot.Flameshot gui in order to make it work. Have fun with your superior screenshot tool 🎉

Thank you so much man this worked for me

@LK-Hemant I had the same issue fixed it like this

@elvisef
Copy link

elvisef commented Mar 27, 2024

Hey.

What if I wanted to do a printscreen of the window with an opened file menu ?

I have a SublimeText with this addon (enhanced file menu): https://github.com/titoBouzout/SideBarEnhancements

And if I do a printscreen, nothing happens. I need to close the menu (I mean the right click button menu) to make the shortcut work.

Any ideas ?

@Amasuri
Copy link

Amasuri commented Jul 14, 2024

Worked perfectly, thanks! Figured out every step aside from typing flameshot gui specifically, so I just typed flameshot and that simply opened the app, haha. Can confirm it requires removing the default PrtScr binding first though! If you skip it, you won't be able to define the custom PrtScr action.

@natema
Copy link

natema commented Nov 19, 2024

I had the same issue as @LK-Hemant, on Fedora 41, Gnome 47.1. This flameshot-org/flameshot#3252 also appear to be the same. The shortcut flameshot gui errors, while gnome-terminal -- flameshot gui works but opens a terminal. I also tried using flatpak run org.flameshot.Flameshot gui as suggested by @George33331, but I get the error

Gtk-Message: 09:48:19.058: Failed to load module "canberra-gtk-module"
Gtk-Message: 09:48:19.058: Failed to load module "pk-gtk-module"
Gtk-Message: 09:48:19.059: Failed to load module "canberra-gtk-module"
Gtk-Message: 09:48:19.059: Failed to load module "pk-gtk-module"
qt.qpa.qgnomeplatform: Could not find color scheme  ""
Qt: Session management error: Could not open network socket
flameshot: error: Unable to capture screen
flameshot: error: Unable to capture screen
flameshot: info: Screenshot aborted.

@Kornelljus
Copy link

I had same issue and was able to solve by passing all variables via script as when triggered via a shortcut, GNOME doesn't pass all these variables, especially under Wayland (which my laptop is on), which requires stricter permissions.
First you make script flameshot.sh.

#!/bin/bash
export DISPLAY=:0
export WAYLAND_DISPLAY=$WAYLAND_DISPLAY
export DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS
/usr/bin/flameshot gui

Make sure it can be executed chmod +x flameshot.sh and then just add this script in keyboard shortcuts instead. i.e. /usr/local/bin/flameshot.sh

Hope that helps

@natema
Copy link

natema commented Nov 23, 2024

(@Kornelljus, I jumped the gun in saying that it was working perfectly in the previous version of this message).
With Kornelljus' trick the shortcut does work but it oddly shows only a cropped version of the screen in the flameshot editor.
Say that what is currently shown on display is
Screenshot From 2024-11-23 09-07-23
then pressing prt sc which runs /usr/bin/flameshot gui after exporting the env variables I only see a cropped version of it:
image
However, after saving it I correctly get
Screenshot From 2024-11-23 09-07-23
Any idea on how to fix that?

@Kornelljus
Copy link

Kornelljus commented Nov 23, 2024

Yeah, it does not show that GUI window. It shows takimg full screenshot of your screen and does not show that menu or whatever you call it. But if you click mouse after that "flash" and drag, you will get that specific area pop-up as it should an allow you to draw, etc.

@natema
Copy link

natema commented Nov 23, 2024

@Kornelljus sorry I was probably unclear in my post. I don't see a problem with flameshot's gui, the problem is that after the flash, I can only edit a portion of the original display. Here is an image where I try to show the problem:
flameshot_bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment