pkgs/record-screen: hide wf-recorder

This commit is contained in:
b12f 2024-09-06 17:38:43 +02:00
parent 048e6a6bb4
commit f015e9c6fa
Signed by: b12f
GPG key ID: 729956E1124F8F26

View file

@ -2,10 +2,10 @@ self:
with self; ''
set -e
RECORDER_PID=$(${procps}/bin/ps aux | ${gnugrep}/bin/grep "\--class screen-recorder" | ${gnugrep}/bin/grep -v grep | ${gawk}/bin/awk '{print $2}')
RECORDER_PID=$(${procps}/bin/ps aux | ${gnugrep}/bin/grep "wf-recorder" | ${gnugrep}/bin/grep -v grep | ${gawk}/bin/awk '{print $2}')
NUM_PID=$(echo -n $RECORDER_PID | ${coreutils}/bin/wc -w)
if (( NUM_PID > 0 )); then
FILE_LOCATION=$(${procps}/bin/ps aux | ${gnugrep}/bin/grep "\--class screen-recorder" | ${gnugrep}/bin/grep -v grep | ${gawk}/bin/awk '{print $NF}')
FILE_LOCATION=$(${procps}/bin/ps aux | ${gnugrep}/bin/grep "wf-recorder" | ${gnugrep}/bin/grep -v grep | ${gawk}/bin/awk '{print $NF}')
kill $RECORDER_PID
${libnotify}/bin/notify-send "Recorded to $FILE_LOCATION"
exit 0
@ -21,8 +21,6 @@ with self; ''
RESOLUTION="$(echo $GEOMETRY | ${gawk}/bin/awk '{print $2}')"
FILE_LOCATION="$HOME/Videos/Screenrecordings/$(${coreutils}/bin/date +%Y%m%d_%Hh%Mm%Ss)_$RESOLUTION.mp4"
echo "Recording $GEOMETRY into $FILE_LOCATION"
${alacritty}/bin/alacritty \
--class screen-recorder \
-e ${wf-recorder}/bin/wf-recorder -g "$GEOMETRY" -f "$FILE_LOCATION"
${wf-recorder}/bin/wf-recorder -g "$GEOMETRY" -f "$FILE_LOCATION"
${libnotify}/bin/notify-send "Recording to $FILE_LOCATION"
''