Skip to content

feat(record): add capture and audio modes, and an explicit stop - #150

Open
devalentineomonya wants to merge 1 commit into
caelestia-dots:mainfrom
devalentineomonya:record-modes
Open

feat(record): add capture and audio modes, and an explicit stop#150
devalentineomonya wants to merge 1 commit into
caelestia-dots:mainfrom
devalentineomonya:record-modes

Conversation

@devalentineomonya

Copy link
Copy Markdown

Recording could only capture the focused monitor or a dragged region, and the only way to end one was to run record again and hope nothing else had toggled it in the meantime. This adds the pieces a front-end needs to drive the recorder directly.

Note

Pairs with caelestia-dots/shell#1826, which puts these controls in the shell's utilities card. This PR stands on its own — the new flags are useful from a keybind or a terminal either way.

--mode {fullscreen,region,window}

Window mode feeds slurp the geometry of every mapped window, so picking one is a click rather than a freehand drag over its edges. From there it reuses the existing region path, including matching the capture framerate to the fastest monitor the window covers.

--audio {none,system,mic,combined}

Maps onto the PipeWire default aliases gpu-screen-recorder already understands (default_output, default_input, and the two combined), so there is no device enumeration to go stale.

--stop

Ends a recording without the toggle guesswork. A front-end that already knows a recording is running should be able to say so, rather than sending a toggle and hoping.

Also

Cancelling out of slurp now returns instead of raising a CalledProcessError traceback — backing out of a region or window selection is a normal thing to do, not an error.

Existing flags are untouched: bare record still toggles, and -r/-s/-c behave exactly as before. Fish completions updated for the new flags, plus -p/--pause which was previously missing.

Testing

Verified against live Hyprland: fullscreen and region capture, and each audio mode producing the expected gpu-screen-recorder invocation. An end-to-end --audio system run followed by --stop produced a valid file — h264 1920x1080 video with an opus audio track — saved to the recordings directory. Window mode needs interactive selection, so it was checked by inspection of the region it hands off rather than automated.

Recording could only capture the focused monitor or a dragged region, and the
only way to end one was to run `record` again and hope nothing else had
toggled it in the meantime.

`--mode` picks fullscreen, region or window. Window mode feeds slurp the
geometry of every mapped window, so picking one is a click rather than a
freehand drag over its edges, and it reuses the region path from there.

`--audio` picks none, system, mic or combined, mapped onto the PipeWire
default aliases gpu-screen-recorder already understands.

`--stop` ends a recording without the toggle guesswork, which is what a
front-end needs when it is driving the recorder rather than a keybind.

Cancelling out of slurp now returns instead of raising, since backing out of
a region or window selection is a normal thing to do rather than an error.

Existing flags are untouched: bare `record` still toggles, and `-r` and `-s`
behave as before.
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