Fixing Flameshot on Hyprland (Wayland & ArchLinux)

Search for a command to run...

No comments yet. Be the first to comment.
After 6 or 7 years on Hack The Box, competing, failing, learning, and coming back again, I finally reached the Top 7 worldwide. The number itself is not what matters most, but everything behind it: ti

Anonymous SMB and NTLM theft enable Kerberoasting; forged silver tickets and MSSQL/token impersonation achieve SYSTEM.

In the Cybersecurity world, paranoia is part of daily life. We usually talk about flaws in terms of exploits, payloads, or bypasses. However, not all failures are due to bugs. Sometimes, it's the product design itself, which can be even more alarming...

INFO: Ports and Services 53/tcp open domain 88/tcp open kerberos-sec 135/tcp open msrpc 139/tcp open netbios-ssn 389/tcp open ldap 445/tcp open microsoft-ds 464/tcp open kpasswd5 593/tcp open http-rpc-epmap 636/tcp open ldapssl 32...

Flameshot is one of those tools I end up using all the time. It is simple, lightweight, and just works for quick screenshots. You can capture, annotate, blur sensitive data, and copy straight to the clipboard without thinking too much.
For pentesting, daily work, or even during certifications, it fits perfectly. It is fast, minimal, and does not get in the way.
That is why this issue was annoying enough to dig into.
I ran into this while using Hyprland (Wayland) with a mixed monitor setup and Flameshot just refused to behave. The overlay was cut, offset, or only covering part of the screens.
This is not random. It comes from how Flameshot handles Wayland and multi-monitor layouts.
The official docs mention the basics (XDG portals, grim, etc): https://flameshot.org/docs/guide/wayland-help/
That is necessary, but not enough when your layout is not clean.
This is just my case, you will need to adapt it:
one horizontal monitor (1920x1080)
one vertical monitor (1080x1920, rotated)
layout offset with negative Y
With this, Flameshot fails to understand the real screen space.
Hyprland needs XDG portals so apps can capture the screen.
sudo pacman -S xdg-desktop-portal xdg-desktop-portal-hyprland
Also make sure Flameshot is using grim (this is in the docs, but easy to miss):
~/.config/flameshot/flameshot.ini
[General]
disabledGrimWarning=true
useGrimAdapter=true
Most examples use something like:
size = (monitor_w*2) (monitor_h)
This only works if:
monitors have the same resolution
no rotation
no weird offsets
Once you break that, it stops working.
Instead of trusting Flameshot, just define the real screen area yourself.
hyprland.conf:
windowrule {
name = flameshot-multi-display-fix
match:class = flameshot
float = on
pin = on
move = 0 -420
size = 3000 1920
rounding = 0
border_size = 0
animation = fade
}
move = 0 -420
This sets where the capture area starts. In my case, one monitor sits higher, so I needed a negative Y. You need to look at your layout and match the highest point across all monitors.
size = 3000 1920
This is the full bounding box of everything combined.
My math:
width = 1920 (main) + 1080 (vertical) = 3000
height = total vertical span = 1920
Yours will be different. Think in terms of total canvas, not individual screens.
Flameshot is not aware of complex layouts on Wayland. Instead of trying to make it figure it out, you give it the exact area it should cover. It looks a bit manual, but it is stable.