dmenurecord script

This commit is contained in:
krolyxon 2022-08-15 13:18:31 +05:30
parent d213a09b2b
commit 20491f2f6a
2 changed files with 31 additions and 1 deletions

View File

@ -2,8 +2,9 @@ https://blog.rust-lang.org/feed.xml "programming"
https://matklad.github.io/feed.xml "programming" https://matklad.github.io/feed.xml "programming"
https://ihatereality.space/rss.xml "programming" https://ihatereality.space/rss.xml "programming"
https://fasterthanli.me/index.xml "programming" https://fasterthanli.me/index.xml "programming"
https://digdeeper.neocities.org/atom.xml https://digdeeper.club/atom.xml
https://gnulinuxindia.org/index.xml https://gnulinuxindia.org/index.xml
https://krolyxon.vern.cc/atom.xml
https://lukesmith.xyz/rss.xml https://lukesmith.xyz/rss.xml
https://landchad.net/rss https://landchad.net/rss
https://news.ycombinator.com/rss https://news.ycombinator.com/rss

29
.local/bin/dmenurecord Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh
screencast() { \
ffmpeg -f x11grab -r 30 -s 1920x1080 -i :0.0 \
-f pulse -ac 2 -ar 48000 -i alsa_output.pci-0000_00_1b.0.analog-stereo.monitor \
~/vids/recs/"$(date '+%C%y-%m%M-%d-%H-%M-%S').mp4" &
echo $! > /tmp/recordingpid
}
killrecording() {
recpid="$(cat /tmp/recordingpid)"
kill -15 "$recpid"
rm -f /tmp/recordingpid
sleep 3
kill -9 "$recpid"
exit
}
asktoend() { \
response=$(printf "No\\nYes" | dmenu -i -p "Recording still active. End recording?") &&
[ "$response" = "Yes" ] && killrecording
}
if [ -f /tmp/recordingpid ]; then
asktoend && exit
else
screencast
fi