Issues with Flameshot utility ubuntu 24.04

In my opintion the best screenshot utility availabe under ubuntu is flameshot.

To install:

sudo apt install flameshot

But under ubuntu 24.04 there is a problem with the installed package.

When you try to take a screenshot you get this message:

Flameshot Error
Unable to capture screen

The problem is that the package assumes XORG rather than wayland, for its interaction with the display. So one needs to get it to assume wayland instead.

Some people have been using an autostart script which invokes flameshot with the correct parameter. The consequence is a flameshot mini-icon which when used behaves correctly.

To get that you just need to create an autostart desktop here:

${HOME}/.config/autostart/flameshot-custom.desktop

With these contents:

[Desktop Entry]
Type=Application
Name=Flameshot wayland fixed
Exec=sh -c "QT_QPA_PLATFORM=wayland flameshot"
X-GNOME-Autostart-enabled=true

But I prefer to use a keyboard shortcut rather such a mini icon to get my screenshots.

You set that up by using the settings app to add a shortcut:

settings->keyboard->view and customize shortcuts->custom shortcuts->+

Name: Flameshot

Command:

sh -c "QT_QPA_PLATFORM=wayland flameshot gui"

Shortcut: You choose the key you want.

I like to use printscreen.

On my system printscreen is <fn><right-shift>

Using that overrides the default screenshot which also uses printscreen.

Published by Pierre Bernatchez in «troubleshoot». Key Words: GUI, wayland, xorg, screenshot, flameshot, GDM