From c1037b22d6534a92e1efaff603ce385615f5da0b Mon Sep 17 00:00:00 2001 From: xyz Date: Tue, 28 Sep 2021 15:01:16 -0700 Subject: reco, use read instead of head tail --- .local/bin/reco | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '.local') diff --git a/.local/bin/reco b/.local/bin/reco index 3b4cc6cc..c07e15b6 100755 --- a/.local/bin/reco +++ b/.local/bin/reco @@ -18,9 +18,9 @@ recodir="$XDG_VIDEOS_DIR/recordings/" mkdir -p "$recodir" if [ -e "$infofile" ]; then - kill "$(head -n1 "$infofile")" + read -r pid tmpfile < "$infofile" + kill "$pid" notify-send 'finish recording, start converting' - tmpfile="$(tail -n1 "$infofile")" ffmpeg -i "$tmpfile" "$recodir/$(time.uuid).mkv" && notify-send 'finish converting' rm "$tmpfile" "$infofile" else @@ -29,5 +29,5 @@ else # arch wiki way # no audio, less cpu use during capturing (fast?), large file size, need convert afterward ffmpeg -y -f x11grab -framerate 25 -i "$DISPLAY" -c:v ffvhuff "$tmpfile" & - printf '%s\n%s' "$!" "$tmpfile" > "$infofile" + printf '%s\t%s' "$!" "$tmpfile" > "$infofile" fi -- cgit v1.2.3-70-g09d2