Screenshots are not simple in Linux
Today I spent three hours on yet another round of troubleshooting in Linux to make it do simple things once again. I needed a program for taking screenshots. Previously, on i3, I used Flameshot and had no issues. It was a great utility. It reminded me of the Windows equivalent, Lightshot, which was used back in the days when Windows didn't have a built-in screenshot tool.
But on #hyprland, it refused to work. Well, technically... you can get it to work by setting XDG_CURRENT_DESKTOP=sway flameshot gui, but the clipboard functionality won't work, and all you'll encounter is: qt.qpa.wayland: Wayland does not support QWindow::requestActivate().
Someone on Reddit mentioned that pip install pyqt6 solves the problem, but that's not the case. I had to give up on Flameshot and start looking for alternatives. All I needed was for the program to be able to:
Freeze the screen when the program is activated.
Select an area for taking a screenshot (screenshotting the entire monitor on an ultra-wide monitor and sending it to people is just cruel).
Edit the image in real-time (I needed arrows to point out specific areas and create solid squares to obscure sensitive data).
Copy to the clipboard.
In theory, these are not outlandish requests. These are completely reasonable requirements for a screenshot program in today's world. But the community thinks differently. The options available on ArchWiki vary significantly in terms of support for compositing managers. Almost all of them are written for X11, while the new #hyprland that I decided to try uses #wayland. Almost nothing works under #wayland except for Grim and Swappy. But even they do not meet my requirements. Grim takes a screenshot instantly, and you won't know if it was taken or not; you also can't select the area you want, so the community suggests using Grim in conjunction with Slurp. But even that doesn't solve all the problems! What about image editing and the choice between saving to clipboard and saving to a file?
Among those I liked on Awesome Hyprland, there was Satty written in Rust. Even the developer was inspired by Flameshot when creating it! But even that refused to work ??♂? Complete inspiration from Flameshot, now that's what I understand...
领英推荐
I had to try Swappy written in C. It seemed fine. It captures individual parts of the screen, edits the image, the clipboard works, and it saves to a file, BUT the screen freeze feature doesn't work, which can be quite important in certain situations. I had to dig deeper.
Through searching for information on Reddit, I discovered that many use Grimblast, which has a screen freeze function. I checked out the excellently written README, which said, "just put it in /bin/ and run it." Awesome, I thought, and started reading the code. It turned out that this utility is just a regular Bash script! Hahaha! Seeing mentions of freeze in the code, I found out that in #hyprland, the utility responsible for freezing is Hyprpicker, and Grimblast consists of Grim and Slurp!
The story ends with me having to create a chain of workarounds from Hyprpicker in the Grimblast script with stdin redirected to Swappy instead of having one full-fledged program, Flameshot, which did the essentials.
Here's the complete bind for #hyprland from my config:
bind =, F6, exec, grimblast --freeze save area - | swappy -f -