From 20491f2f6a1f97678c5149e7abbe10501e7db7f4 Mon Sep 17 00:00:00 2001 From: krolyxon Date: Mon, 15 Aug 2022 13:18:31 +0530 Subject: [PATCH] dmenurecord script --- .config/newsboat/urls | 3 ++- .local/bin/dmenurecord | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 .local/bin/dmenurecord diff --git a/.config/newsboat/urls b/.config/newsboat/urls index 6a24d67..0806aa9 100644 --- a/.config/newsboat/urls +++ b/.config/newsboat/urls @@ -2,8 +2,9 @@ https://blog.rust-lang.org/feed.xml "programming" https://matklad.github.io/feed.xml "programming" https://ihatereality.space/rss.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://krolyxon.vern.cc/atom.xml https://lukesmith.xyz/rss.xml https://landchad.net/rss https://news.ycombinator.com/rss diff --git a/.local/bin/dmenurecord b/.local/bin/dmenurecord new file mode 100755 index 0000000..38e199f --- /dev/null +++ b/.local/bin/dmenurecord @@ -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