144

I needed to highlight some text in my screenshots and I did not know how to do it with the default screenshot app. Flameshot is a solution. I installed it.

How can I replace the PrtScr shortcut-key so that it launches Flameshot?

muru
  • 207,228

14 Answers14

239

If you need or want to replace the PrtScr shortcut do the following:

  1. Release the PrtScr binding by this command

    gsettings set org.gnome.settings-daemon.plugins.media-keys screenshot '[]'
    
  2. Go to Settings -> Devices -> Keyboard and scroll to the end. Press + and you will create custom shortcut.
    custom shortcuts in ubuntu 18.04

  3. Enter name: "flameshot", command: /usr/bin/flameshot gui or /snap/bin/flameshot.

  4. Set shortcut to PrtScr (print).

That is it. Next time you push PrtScr flameshot will be launched.


Source: Posted in the question by OP which should have been posted as an answer instead.

pomsky
  • 70,557
49

Install and setup flameshot via terminal ... if there is no custom0 shortcut / binding configured

Install flameshot:

sudo apt install flameshot

Release the PrtScr binding by this command:

Ubuntu 19.10 (Credits: @jobou's comment)

gsettings set org.gnome.settings-daemon.plugins.media-keys screenshot '[]'

Older Ubuntu versions:

gsettings set org.gnome.settings-daemon.plugins.media-keys screenshot ''

Set new custom binding:

gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/']"

Set name:

gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ name 'flameshot'

Set command:

gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ command '/usr/bin/flameshot gui'

Set binding:

gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ binding 'Print'
Philipp
  • 777
Marius
  • 599
20

In case you installed Flameshot via snapcraft.io and not via standard sudo apt install flameshot, then the path /usr/bin/flameshot gui will not work, because the path is different.

  1. So, first run command type flameshot (for Ubuntu 18.04 and higher). This will show you the path where app is installed.

  2. Copy this path.

  3. Press Super and search for keyboard shortcut.

  4. Find word screenshot

    see this example

  5. Edit it (in my case, I assigned Shift+Ctrl+Alt+~ as I have never used this key combo)

  6. Then go back, click + symbol and add the path you have copied to command.

    and see this example

Imperixal
  • 201
18

This is tested on Ubuntu 20.04

  1. Disable PrtScr or Print shortcut by opening the Keyboard Shortcuts Settings

  2. Navigate to Keyboard Shortcuts on bottom left menu, then select Print shortcut which is to Save a screenshot to Pictures

    keyboard shortcuts dialog

  3. Hit Backspace to disable the current keyboard shortcut so that we can use this for Flameshot later.

  4. Hit Set to apply/confirm it.

    enter image description here

  5. Identify Flame binary location with which command

    $ which flameshot
    /usr/bin/flameshot
    
  6. Then, scroll down to the bottom and select + symbol to add new shortcut.

    enter image description here

  7. Add Custom Shortcut

    • Name: Flameshot
    • Command: /usr/bin/flameshot gui
    • Shortcut: Print

    enter image description here

That's it

Zanna
  • 72,312
4

Or simply set any shortcut (including PrtScr) to flameshot gui: as indicated in the other answers, only without the need for any other setting. You will be asked if you want to remap the key (in Xfce at least, but I guess it's the same in most desktops).

You might consider keeping PrtScr for the default screenshot tool and use other shortcuts for flameshot, at least two I mean, because you can also capture screen with delay: for a 5-second delay, use flameshot gui -d 5000.

More here.

cipricus
  • 4,066
  • 4
  • 47
  • 106
3
  1. Open the System Settings app and select Devices, then go to Keyboard.
  2. Scroll down to Screenshots. Select Save a screenshot to Pictures and hit delete to disable the shortcut.
  3. Then scroll all the way to the bottom and hit the plus button. Here, give it a name and type the Flameshot command you want to bind to the shortcut.
  4. Then set the shortcut as Print Screen and for command type flameshot gui.

You’re done.

1

Ubuntu 20.04:

  1. Remove the keyboard shortcut assigned for PrtScr:

    Settings -> Keyboard Shortcuts -> Click Save a screenshot to Pictures -> Press Backspace to unassign.

  2. Assign Flameshot to PrtScr:

    Press the + icon -> Name: Flameshot -> Command: flameshot GUI -> Set Shortcut -> Press PrtScr -> Click Add to save.

Zanna
  • 72,312
abeciaj
  • 76
1

Steps worked on Pop!_OS 22.04.

  1. Go to Settings -> Keyboard -> Keyboard Shortcuts -> View and Customize shortcuts.

  2. Search 'screenshot' and remove the 'Take a screenshot interactively'.

    Configuration

  3. In the same window, search for Custom shortcuts -> Add (+ icon) -> Set this configuration:

Screenshot by Flameshot /usr/bin/flameshot GUI Print (or the key you want to configure)

enter image description here

karel
  • 122,292
  • 133
  • 301
  • 332
1

For Ubuntu 23.10

  1. Install Flameshot as explained here: https://flameshot.org/docs/installation/installation-linux/#distro-specific

  2. Open Settings, find the Keyboard tab, find the Keyboard Shortcuts, and click on View and Customize Shortcuts: enter image description here

  3. Search for screenshot on the new window and disable related shortcuts: enter image description here

  4. Clear the search bar on the same window and scroll down to find Custom Shortcuts: enter image description here

  5. Add a new shortcut for Flameshot: enter image description here

  6. Type a name you prefer, and use this as the command flameshot gui: enter image description here

  7. Click on the Set Shortcut and set the print key on your keyboard: enter image description here

  8. Click on the Add button and you are done.

Ali Samie
  • 127
0

Working in Kubuntu 20.10 :

Go to System Settings

SystemSettings

Shortcuts > Global shortcuts

Settings_shotcut

click Add Application button (you can type "flameshot" on the search box)

addAplication

click OK

After adding the application, you should see a tab with Take screenshot description.

link PrtScr key to shortcut

Click on it, and press the PrtSc key on your keyboard to set the shortcut.

Enjoy :)

Zanna
  • 72,312
X00D45
  • 1
0

Just an update to the solution that other people wrote about already. If you did everything correct and still nothing happens when pressing the "Print Screen" button. Double check if you haven't installed flameshot via snap. If you did then command would be a bit different:

/snap/bin/flameshot gui

To find your exact flameshot location path type in terminal

type flameshot

And you should be able to see exact path to the executable you should be using as command (just add additional gui keyword behind it). Hope that helps.

Cheers!

Игор
  • 231
0

An update for those that have installed via FlatPak. The binary command to bind to your shortcut key is:

/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/bin/flameshot org.flameshot.Flameshot gui --delay 500

At least, that's what it is on Ubuntu Jammy/Mint Vera x86_64.

I found that command by examining the .desktop file @ /var/lib/flatpak/exports/share/applications:

egrep ^Exec.*gui /var/lib/flatpak/exports/share/applications/org.flameshot.Flameshot.desktop

And taking the command after the Exec= line.

Pete
  • 11
  • 3
0

Sadly in Ubuntu 24.04 the

/usr/bin/flameshot gui

does not work anymore.

This is a working command for the keyboard shortcut mentioned above:

sh -c "flameshot gui"

Or checkout any other method mentioned here at the end:

https://github.com/flameshot-org/flameshot/issues/3365

Isengo
  • 518
0

this is command works on Ubuntu Ubuntu 24.04 with wayland disabled, a custome environment varuiable is sent inluine to the command.

sh -c "QT_QPA_PLATFORM=wayland flameshot gui"

https://flameshot.org/docs/guide/wayland-help/#gnome-shortcut-does-not-trigger-flameshot