added own notification script
This commit is contained in:
@@ -15,9 +15,24 @@ start() {
|
||||
video_path="$HOME/Videos/replay/"
|
||||
mkdir -p "$video_path"
|
||||
notify-send -u low "$PROGRAM_NAME" "$PROGRAM_NAME is starting ..."
|
||||
gpu-screen-recorder -w screen -f 120 -a default_output -a default_input -fm vfr \
|
||||
-c mkv -bm qp -cr full -tune quality -k av1_10bit -q very_high -r 120 \
|
||||
-replay-storage ram -ab 320 -cursor yes -keyint 2 -o "$video_path" &> /dev/null &
|
||||
gpu-screen-recorder \
|
||||
-w screen \
|
||||
-f 60 \
|
||||
-a default_output -a default_input \
|
||||
-fm vfr \
|
||||
-c mkv \
|
||||
-encoder gpu \
|
||||
-bm qp \
|
||||
-cr full \
|
||||
-tune quality \
|
||||
-k av1_10bit \
|
||||
-q high \
|
||||
-r 120 \
|
||||
-replay-storage ram \
|
||||
-ab 320 \
|
||||
-cursor yes \
|
||||
-sc "$HOME/.config/hypr/scripts/replay-notification.sh" \
|
||||
-o "$video_path" &> /dev/null &
|
||||
echo $! > "$PID_FILE"
|
||||
}
|
||||
|
||||
@@ -41,7 +56,7 @@ save() {
|
||||
if [ -f "$PID_FILE" ]; then
|
||||
PID=$(cat "$PID_FILE")
|
||||
if ps -p "$PID" > /dev/null; then
|
||||
pkill -SIGUSR1 -f gpu-screen-recorder && sleep 0.5 && notify-send -u low "$PROGRAM_NAME" "Saving replay..."
|
||||
pkill -SIGUSR1 -f gpu-screen-recorder
|
||||
else
|
||||
# The process is not running, but the PID file exists.
|
||||
# This can happen if the process crashed.
|
||||
|
17
hypr/scripts/replay-notification.sh
Executable file
17
hypr/scripts/replay-notification.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
PROGRAM_NAME="gpu-screen-recorder"
|
||||
|
||||
case "$2" in
|
||||
replay)
|
||||
notify-send -u low "$PROGRAM_NAME" "Replay saved: $1"
|
||||
;;
|
||||
regular)
|
||||
notify-send -u low "$PROGRAM_NAME" "Stream/Video saved: $1"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {saved_file} {replay|regular}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
Reference in New Issue
Block a user