Skip to content

Record the screen on X11 - #9

Merged
DevanMetz merged 4 commits into
mainfrom
grok/x11-recording
Oct 28, 2026
Merged

DevanMetz merged 4 commits into
mainfrom
grok/x11-recording

Conversation

@DevanMetz

Copy link
Copy Markdown
Owner

What changed

Linux can record a region to an H.264 MP4 on X11. Choose Record video in the tray, or run opensnip --record, then select a region the same way as a snip. F and A record the monitor under the cursor.

The recording stays on one monitor, with even dimensions. A red outline and a bar (pause, microphone, stop, discard) stay on screen. Those windows are painted out of the frames using the wallpaper pixmap and the windows underneath. Optional system audio and microphone use PulseAudio or PipeWire through pactl. Pause cuts a new segment and joins the files at the end. The MP4 is saved under ~/Videos/OpenSnip and, when xclip or wl-copy is available, copied as text/uri-list.

Settings gains a Recording page and a recordings folder. PARITY.md lists what still differs from Windows.

Wayland recording is not implemented. The app says that recording needs an X11 session. ffmpeg is required and is not bundled. Win+Shift+R is still not a built-in global shortcut.

Windows behavior is unchanged.

Why

Screen recording was the largest Linux gap with no open pull request. The Windows flow is region selection, countdown, a control bar that never appears in the file, and an MP4 in Videos.

How it was tested

  • dotnet test tests/OpenSnip.Recording.Tests/OpenSnip.Recording.Tests.csproj -c Release — 19 passed. On this X11 display that includes a grab that paints out an overlapping window, a real ffmpeg recording of a red window, joining two segments, and a session that shows the control bar and writes an MP4 whose frame is red.
  • dotnet build src/OpenSnip.csproj -c Release -p:EnableWindowsTargeting=true — succeeded.
  • Live tests skip when DISPLAY is unset, which is what CI does. They need ffmpeg only when a display is present.

Clip a selection to one monitor with even dimensions, parse PulseAudio
sources, and build an ffmpeg command that can pause by cutting segments.
The grabber reads the X11 root and paints excluded windows back out.
X11 gets the red outline, countdown, and pause, mic, stop, and discard
bar. Those windows are left out of the frames. Wayland reports that
recording needs an X11 session. ffmpeg is required and is not bundled.
# Conflicts:
#	.github/workflows/build.yml
#	README.md
#	linux/App.cs
#	linux/Cli.cs
#	linux/ClipboardService.cs
#	linux/Diagnostics.cs
#	linux/OverlayWindow.cs
#	linux/SettingsWindow.cs
#	linux/SingleInstance.cs
@DevanMetz
DevanMetz merged commit 1f5bab4 into main Oct 28, 2026
2 checks passed
@DevanMetz
DevanMetz deleted the grok/x11-recording branch October 28, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant