mirror of
https://github.com/quantum5/wayland-recorder.git
synced 2025-04-24 04:01:58 -04:00
Add initial code
This commit is contained in:
parent
2115375924
commit
f8873f6bdf
10
record-screen
Executable file
10
record-screen
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
if ! pkill -INT -P "$(pgrep -xo record-screen)" wf-recorder 2>/dev/null; then
|
||||||
|
geometry="$(slurp -d)"
|
||||||
|
if [ -n "$geometry" ]; then
|
||||||
|
pkill -USR1 -x record-screend
|
||||||
|
mkdir -p ~/Videos/Recordings
|
||||||
|
wf-recorder -f ~/Videos/Recordings/"screen-record-$(date +%Y-%m-%d-%H-%M-%S).mp4" -g "$geometry"
|
||||||
|
pkill -USR2 -x record-screend
|
||||||
|
fi
|
||||||
|
fi
|
32
record-screend
Executable file
32
record-screend
Executable file
|
@ -0,0 +1,32 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
recordings=0
|
||||||
|
|
||||||
|
update() {
|
||||||
|
if [ "$recordings" -gt 0 ]; then
|
||||||
|
echo " Recording"
|
||||||
|
else
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
begin_record() {
|
||||||
|
recordings=$((recordings + 1))
|
||||||
|
update
|
||||||
|
}
|
||||||
|
|
||||||
|
end_record() {
|
||||||
|
recordings=$((recordings - 1))
|
||||||
|
update
|
||||||
|
}
|
||||||
|
|
||||||
|
exec sleep infinity &
|
||||||
|
|
||||||
|
pid="$!"
|
||||||
|
trap begin_record SIGUSR1
|
||||||
|
trap end_record SIGUSR2
|
||||||
|
trap "kill $pid" EXIT
|
||||||
|
|
||||||
|
while :; do
|
||||||
|
wait "$pid"
|
||||||
|
done
|
Loading…
Reference in a new issue