diff options
| author | Justine Smithies <justine@smithies.me.uk> | 2026-08-19 20:06:44 +0100 |
|---|---|---|
| committer | Justine Smithies <justine@smithies.me.uk> | 2026-08-19 20:06:44 +0100 |
| commit | 7f11e930d549f78ddc892639b4946f616a8e0945 (patch) | |
| tree | 81567fd439f14b3f132f47faf5630308763a7ee3 /.local/bin | |
| parent | 27e8028eba84aa75504aa14f524048f25d87a0ad (diff) | |
Added a new script with keybindings to record the focused output, window or selected region.
Diffstat (limited to '.local/bin')
| -rwxr-xr-x | .local/bin/screenrecord.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/.local/bin/screenrecord.sh b/.local/bin/screenrecord.sh new file mode 100755 index 0000000..c60d46c --- /dev/null +++ b/.local/bin/screenrecord.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# Get focused output +output="$( moocow show windows | jq -r '.data[] | select(.focused == true) | .output')" + +case $1 in + selected-region) + # Record the selected region + wf-recorder -g "$(slurp)" -f ~/Videos/"$(date +%Y-%m-%d_%H-%m-%s)".mkv + ;; + focused-window) + # Record the focused window + geometry=$(moocow winops -I | jq -r '.data.frame | "\(.x),\(.y) \(.width)x\(.height)"') + echo "$geometry" + wf-recorder -g "$geometry" -f ~/Videos/"$(date +%Y-%m-%d_%H-%m-%s)".mkv + ;; + *) + # Record the currently focused output and save it into Screenrecordings + wf-recorder -o "$output" -f ~/Videos/"$(date +%Y-%m-%d_%H-%m-%s)".mkv + ;; +esac |
