From 087f199ca0e03892a9501c0676bc023136b9a7ea Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Sat, 9 Aug 2025 20:01:04 +0200 Subject: [PATCH] added own notification script --- fish/fish_variables | 4 ++-- hypr/scripts/replay-ctrl.sh | 23 +++++++++++++++++++---- hypr/scripts/replay-notification.sh | 17 +++++++++++++++++ 3 files changed, 38 insertions(+), 6 deletions(-) create mode 100755 hypr/scripts/replay-notification.sh diff --git a/fish/fish_variables b/fish/fish_variables index 4e1873f..b319615 100644 --- a/fish/fish_variables +++ b/fish/fish_variables @@ -5,8 +5,8 @@ SETUVAR DATABASE_URL:sqlite\x3adatabase\x2esqlite SETUVAR GLFW_IM_MODULE:ibus SETUVAR MANPAGER:sh\x20\x2dc\x20\x27col\x20\x2dbx\x20\x7c\x20bat\x20\x2dl\x20man\x20\x2dp\x27 SETUVAR RUST_LOG:debug -SETUVAR --export SSH_AGENT_PID:1385 -SETUVAR --export SSH_AUTH_SOCK:/tmp/ssh\x2dXXXXXXbvMvPU/agent\x2e1384 +SETUVAR --export SSH_AGENT_PID:966 +SETUVAR --export SSH_AUTH_SOCK:/tmp/ssh\x2dXXXXXXTYVBUH/agent\x2e965 SETUVAR SXHKD_SHELL:/usr/bin/bash SETUVAR ZO_CMD:zo SETUVAR Z_CMD:z diff --git a/hypr/scripts/replay-ctrl.sh b/hypr/scripts/replay-ctrl.sh index 66503e8..1baab2c 100755 --- a/hypr/scripts/replay-ctrl.sh +++ b/hypr/scripts/replay-ctrl.sh @@ -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. diff --git a/hypr/scripts/replay-notification.sh b/hypr/scripts/replay-notification.sh new file mode 100755 index 0000000..409d972 --- /dev/null +++ b/hypr/scripts/replay-notification.sh @@ -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