summaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
authorxyz <gky44px1999@gmail.com>2021-09-28 15:01:16 -0700
committerxyz <gky44px1999@gmail.com>2021-09-28 15:01:16 -0700
commitc1037b22d6534a92e1efaff603ce385615f5da0b (patch)
treec9a54f59291e48cdd81536983bf78a3e52d75fea /.local
parent800a579473a2e637c68000e65b2a41eaf04e69d1 (diff)
reco, use read instead of head tail
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/reco6
1 files changed, 3 insertions, 3 deletions
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