Screenshots and screen recordings are inverted on monitors with transform applied
Description
When taking screenshots (omarchy-cmd-screenshot) or screen recordings (omarchy-cmd-screenrecord) on a monitor that has a transform applied (e.g., portrait mode rotation), the captured image/video is inverted/rotated incorrectly.
Environment
- Omarchy version: 3.3.3
- Hyprland version: 0.53.1
- grim version: 1.5.0-2
- gpu-screen-recorder version: r1257.640e377-1
Monitor Configuration
monitor=DP-3,[email protected],1296x470,1.6666667
monitor=HDMI-A-1,[email protected],0x0,1.666667
monitor=HDMI-A-1,transform,3
The HDMI-A-1 monitor has transform,3 (270° rotation) for portrait orientation.
Steps to Reproduce
- Configure a monitor with a transform (e.g.,
transform,3for portrait mode) - Focus on a window on that transformed monitor
- Take a screenshot with
Ctrl+Super+4or screen recording withCtrl+Super+5 - The resulting image/video is rotated incorrectly (inverted)
Expected Behavior
Screenshots and screen recordings should appear with the correct orientation, matching what is displayed on screen.
Actual Behavior
The captured content is rotated/inverted because grim and gpu-screen-recorder capture the raw framebuffer before Hyprland applies the display transform.
Root Cause
Both grim and gpu-screen-recorder capture the framebuffer without accounting for Hyprland's display transform. The screenshot/screenrecord scripts would need to:
- Detect if the capture region is on a transformed monitor
- Apply the inverse rotation to the captured image/video
Potential Solutions
For screenshots (omarchy-cmd-screenshot)
Detect the monitor transform and pipe the grim output through ImageMagick to apply the inverse rotation:
# Example: for transform,3 (270°), apply -rotate 90 to correct
grim -g "$SELECTION" - | convert - -rotate 90 - | satty ...
For screen recordings (omarchy-cmd-screenrecord)
Use ffmpeg's -vf transpose filter via the -ffmpeg-opts flag in gpu-screen-recorder, or post-process the video.
Additional Context
This affects any multi-monitor setup where one or more monitors use portrait orientation via Hyprland's transform feature.
What are you choosing to capture when you're using omarchy-cmd-screenrecord? It gives you the option to capture a window, monitor and region. I assume region. But in that case it seems like a bug in hyprland. Recording a rotated monitor works, but selecting a region or window results in incorrect image. This affects other software as well that uses desktop portal capture as well such as obs, so it's safe to assume that it's an hyprland bug (it also works fine with other wayland compositors). So the bug should be reported here instead: https://github.com/hyprwm/xdg-desktop-portal-hyprland or https://github.com/hyprwm/Hyprland depending on where the issue really is
Quick “Slop” Solution
If you need a fast, minimal modification to get the script working, you can use this sed command:
sed -i 's|grim -g "\$SELECTION" -|grim -g "$(slurp)" -|g' ~/.local/share/omarchy/bin/omarchy-cmd-screenshot
What this does:
- It replaces grim -g "$SELECTION" - with grim -g "$(slurp)" - in the script.
- This allows the script to correctly use the slurp selection when capturing screenshots.
Known behavior / side effect:
With this quick fix, the first selection may not be used. The script effectively asks for a region selection twice:
- The first selection is ignored, and the monitor may appear flipped or misaligned.
- After making the second selection, the script captures the screenshot correctly.
⚠️ Warning: This workaround is intended for users who want the script to run immediately with minimal changes, while keeping slurp-based region selection functional.
What are you choosing to capture when you're using omarchy-cmd-screenrecord?
To be clear its screen shot too. and its region based. you're right recording the full monitor doesn't rotate it upside down.
Likewise, having the same issue with a secondary monitor flipped (portrait mode) via hyprland transform. Thanks @rblalock for reporting.