Setting Flameshot as the default screenshot app in Ubuntu

There are a lot of great screenshot apps that you can use to convey information to others. The first one I really liked was Lightshot, which is available for Windows, Mac, or as a Chrome extension. As I am back to using Ubuntu-based Linux distros for work, I needed a similar tool.

I settled on using Flameshot, which I use regularly to highlight bugs in the implementation of projects I oversee. The ability to draw right on the screenshot and to be able to just ctrl+c to copy and insert into a chat is a godsend. You can also upload the screenshot to the cloud and it will auto-copy the link that you can insert into bug tickets easily.

Flameshot can be triggered by clicking the corresponding icon in the taskbar, but when you are hovering over a web element that you need to demonstrate on the screenshot this is not an option. Unfortunately pressing the PrtScr button launches the default system screenshot app and this behavior needs to be overridden to fully utilize Flameshot.

Installing Flameshot

In Ubuntu and derivates you only need to run this command:

sudo apt install flameshot

You can also install it from the software center. In case of Zorin OS that I’m testing currently, the snap version was installed.

After the installation finishes, start the app and make sure that is started with the computer (Launch at startup).

Binding Flameshot to the PrtScr button

First, you have to release the PrtScr binding. On Ubuntu 19.10 or newer use this command:

gsettings set screenshot '[]'

On older Ubuntu versions:

gsettings set screenshot ''

On Pop_OS! 22.04:

gsettings set show-screenshot-ui '[]'

Set new custom binding:

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

Set name:

gsettings set name 'flameshot'

Set command:

(Be aware, that if you installed Flameshot as a snap, the path to the executable will be different and you have to replace it in the command below. Use “type flameshot” to see what the actual path is.)

gsettings set command '/usr/bin/flameshot gui'

Set binding:

gsettings set binding 'Print'

That’s it, pressing the PrtScr button should now launch Flameshot for you!

Update 10-02-2023

Using Zorin OS 16.03 with an AMD Ryzen 9700x I ran into a problem. After installing the AMDGPU-PRO driver for linux, the GUI of Flameshot worked and screenshots could be saved, but could not be copied if Flameshot was installed from apt.

My solution was to install Flameshot using flatpak:

flatpak install flameshot

As the flatpak version has a different path, we need an extra step before the “Set command” step to create a sane executable path. I chose to add a symlink to the /bin directory in my home.

ln --symbolic /var/lib/flatpak/exports/bin/org.flameshot.Flameshot ~/bin/flameshot

After this I ran a bit modofied “Set Command”:

gsettings set command '/home/myusername/bin/flameshot gui'

(Don’t forget to replace “myusernam” with your username 🙂 )

Except for this the rest of the steps are still valid.

Leave a Reply

Your email address will not be published. Required fields are marked *