mirror of
https://github.com/quantum5/wayland-recorder.git
synced 2025-04-24 12:11:57 -04:00
33 lines
404 B
Plaintext
33 lines
404 B
Plaintext
|
#!/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
|