2022-08-14 16:03:32 +00:00
|
|
|
self:
|
|
|
|
with self; ''
|
2024-09-04 23:22:56 +00:00
|
|
|
set -e
|
|
|
|
|
2024-09-06 15:38:43 +00:00
|
|
|
RECORDER_PID=$(${procps}/bin/ps aux | ${gnugrep}/bin/grep "wf-recorder" | ${gnugrep}/bin/grep -v grep | ${gawk}/bin/awk '{print $2}')
|
2024-09-04 23:22:56 +00:00
|
|
|
NUM_PID=$(echo -n $RECORDER_PID | ${coreutils}/bin/wc -w)
|
|
|
|
if (( NUM_PID > 0 )); then
|
2024-09-06 15:38:43 +00:00
|
|
|
FILE_LOCATION=$(${procps}/bin/ps aux | ${gnugrep}/bin/grep "wf-recorder" | ${gnugrep}/bin/grep -v grep | ${gawk}/bin/awk '{print $NF}')
|
2024-09-04 23:22:56 +00:00
|
|
|
kill $RECORDER_PID
|
|
|
|
${libnotify}/bin/notify-send "Recorded to $FILE_LOCATION"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "fullscreen" ]; then
|
|
|
|
GEOMETRY="$(${slurp}/bin/slurp -d -b \#ffffff11 -o)"
|
|
|
|
else
|
|
|
|
GEOMETRY="$(${slurp}/bin/slurp -d -b \#ffffff11)"
|
|
|
|
fi
|
|
|
|
|
2022-08-14 16:03:32 +00:00
|
|
|
mkdir -p "$HOME/Videos/Screenrecordings"
|
2024-09-04 23:22:56 +00:00
|
|
|
RESOLUTION="$(echo $GEOMETRY | ${gawk}/bin/awk '{print $2}')"
|
2022-08-14 16:03:32 +00:00
|
|
|
FILE_LOCATION="$HOME/Videos/Screenrecordings/$(${coreutils}/bin/date +%Y%m%d_%Hh%Mm%Ss)_$RESOLUTION.mp4"
|
|
|
|
echo "Recording $GEOMETRY into $FILE_LOCATION"
|
2024-09-06 15:38:43 +00:00
|
|
|
${wf-recorder}/bin/wf-recorder -g "$GEOMETRY" -f "$FILE_LOCATION"
|
2024-09-04 23:22:56 +00:00
|
|
|
${libnotify}/bin/notify-send "Recording to $FILE_LOCATION"
|
2022-08-14 16:03:32 +00:00
|
|
|
''
|