From 8bce55645fd91dc09c883adc6af5b4083f1e0125 Mon Sep 17 00:00:00 2001 From: Lorenzo Cogotti Date: Sun, 6 Nov 2022 22:55:15 +0100 Subject: [PATCH] [screenrecord.sh] Various improvements. wq --- screenrecord.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/screenrecord.sh b/screenrecord.sh index b9d3382..952df0d 100755 --- a/screenrecord.sh +++ b/screenrecord.sh @@ -23,11 +23,11 @@ # # Author Lorenzo Cogotti, The DoubleFourteen Code Forge -pidfile="/var/run/user/$(id -u)/screenrecord.pid" +pidfile="$XDG_RUNTIME_DIR/screenrecord.pid" filename="$(xdg-user-dir VIDEOS)/ScreenCast_$(date +%F_%T).mp4" isrunning() { - pid=$(cat "$pidfile" 2>/dev/null) + pid=$(2>/dev/null <"$pidfile") test $? && kill -s 0 -- "$pid" 2>/dev/null return $? }