feat(record): add capture and audio modes, and an explicit stop - #150
Open
devalentineomonya wants to merge 1 commit into
Open
feat(record): add capture and audio modes, and an explicit stop#150devalentineomonya wants to merge 1 commit into
devalentineomonya wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recording could only capture the focused monitor or a dragged region, and the only way to end one was to run
recordagain 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
slurpthe 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-recorderalready understands (default_output,default_input, and the two combined), so there is no device enumeration to go stale.--stopEnds 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
slurpnow returns instead of raising aCalledProcessErrortraceback — backing out of a region or window selection is a normal thing to do, not an error.Existing flags are untouched: bare
recordstill toggles, and-r/-s/-cbehave exactly as before. Fish completions updated for the new flags, plus-p/--pausewhich was previously missing.Testing
Verified against live Hyprland: fullscreen and region capture, and each audio mode producing the expected
gpu-screen-recorderinvocation. An end-to-end--audio systemrun followed by--stopproduced 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.