aboutsummaryrefslogtreecommitdiff
path: root/record-selected.sh
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-03-22 13:04:08 +0100
committerdec05eba <dec05eba@protonmail.com>2022-03-22 13:04:08 +0100
commitd4bc7b420ec258040f8f36234d7f2b08f2dd1c38 (patch)
treebc063a403164937959f1ccce678739dab33eae46 /record-selected.sh
parentf81bdfb29e2747c39c982a9f4cbbdaa830c2560a (diff)
Add script to record the selected window (with the active audio device)
Diffstat (limited to 'record-selected.sh')
-rwxr-xr-xrecord-selected.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/record-selected.sh b/record-selected.sh
new file mode 100755
index 0000000..5782ac3
--- /dev/null
+++ b/record-selected.sh
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+
+window=$(xdotool selectwindow)
+active_sink="$(pactl get-default-sink).monitor"
+mkdir -p "$HOME/Videos"
+video="$HOME/Videos/$(date +"Video_%Y-%m-%d_%H-%M-%S.mp4")"
+gpu-screen-recorder -w "$window" -c mp4 -f 60 -a "${active_sink}.monitor" -o "$video"
+notify-send "GPU Screen Recorder" "Saved video to $video"