diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/record-application-name.sh | 6 | ||||
-rwxr-xr-x | scripts/record-save-application-name.sh | 14 | ||||
-rwxr-xr-x | scripts/replay-application-name.sh | 6 | ||||
-rwxr-xr-x | scripts/replay.sh | 2 | ||||
-rwxr-xr-x | scripts/save-recording.sh | 3 | ||||
-rwxr-xr-x | scripts/save-replay.sh | 3 | ||||
-rwxr-xr-x | scripts/start-replay.sh | 5 | ||||
-rwxr-xr-x | scripts/stop-replay.sh | 3 | ||||
-rwxr-xr-x | scripts/toggle-recording-selected.sh | 4 |
9 files changed, 43 insertions, 3 deletions
diff --git a/scripts/record-application-name.sh b/scripts/record-application-name.sh new file mode 100755 index 0000000..0411781 --- /dev/null +++ b/scripts/record-application-name.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +window=$(xdotool selectwindow) +window_name=$(xdotool getwindowclassname "$window" || xdotool getwindowname "$window" || echo "game") +window_name="$(echo "$window_name" | tr '/\\' '_')" +gpu-screen-recorder -w "$window" -f 60 -a "$(pactl get-default-sink).monitor" -o "$HOME/Videos/recording/$window_name/$(date +"Video_%Y-%m-%d_%H-%M-%S.mp4")" diff --git a/scripts/record-save-application-name.sh b/scripts/record-save-application-name.sh new file mode 100755 index 0000000..c002376 --- /dev/null +++ b/scripts/record-save-application-name.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# This script should be passed to gpu-screen-recorder with the -sc option, for example: +# gpu-screen-recorder -w screen -f 60 -a "$(pactl get-default-sink).monitor" -r 60 -sc scripts/record-save-application-name.sh -c mp4 -o "$HOME/Videos" + +window=$(xdotool getwindowfocus) +window_name=$(xdotool getwindowclassname "$window" || xdotool getwindowname "$window" || echo "game") +window_name="$(echo "$window_name" | tr '/\\' '_')" + +video_dir="$HOME/Videos/Replays/$window_name" +mkdir -p "$video_dir" +video="$video_dir/$(date +"${window_name}_%Y-%m-%d_%H-%M-%S.mp4")" +mv "$1" "$video" +sleep 0.5 && notify-send -t 2000 -u low "GPU Screen Recorder" "Replay saved to $video"
\ No newline at end of file diff --git a/scripts/replay-application-name.sh b/scripts/replay-application-name.sh new file mode 100755 index 0000000..7683abb --- /dev/null +++ b/scripts/replay-application-name.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +window=$(xdotool selectwindow) +window_name=$(xdotool getwindowclassname "$window" || xdotool getwindowname "$window" || echo "game") +window_name="$(echo "$window_name" | tr '/\\' '_')" +gpu-screen-recorder -w "$window" -f 60 -c mkv -a "$(pactl get-default-sink).monitor" -r 60 -o "$HOME/Videos/Replays/$window_name" diff --git a/scripts/replay.sh b/scripts/replay.sh index cf6c494..2781e1e 100755 --- a/scripts/replay.sh +++ b/scripts/replay.sh @@ -3,4 +3,4 @@ [ "$#" -ne 4 ] && echo "usage: replay.sh <window_id> <fps> <replay_time_sec> <output_directory>" && exit 1 active_sink="$(pactl get-default-sink).monitor" mkdir -p "$4" -gpu-screen-recorder -w "$1" -c mp4 -f "$2" -a "$active_sink" -r "$3" -o "$4" +gpu-screen-recorder -w "$1" -c mkv -f "$2" -a "$active_sink" -r "$3" -o "$4" diff --git a/scripts/save-recording.sh b/scripts/save-recording.sh new file mode 100755 index 0000000..90fefc1 --- /dev/null +++ b/scripts/save-recording.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +killall -SIGINT gpu-screen-recorder && sleep 0.5 && notify-send -t 1500 -u low "GPU Screen Recorder" "Recording saved" diff --git a/scripts/save-replay.sh b/scripts/save-replay.sh new file mode 100755 index 0000000..f9390aa --- /dev/null +++ b/scripts/save-replay.sh @@ -0,0 +1,3 @@ +#!/bin/sh -e + +killall -SIGUSR1 gpu-screen-recorder && sleep 0.5 && notify-send -t 1500 -u low -- "GPU Screen Recorder" "Replay saved" diff --git a/scripts/start-replay.sh b/scripts/start-replay.sh new file mode 100755 index 0000000..e36d59d --- /dev/null +++ b/scripts/start-replay.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +video_path="$HOME/Videos" +mkdir -p "$video_path" +gpu-screen-recorder -w screen -f 60 -a "$(pactl get-default-sink).monitor" -c mkv -r 30 -o "$video_path" diff --git a/scripts/stop-replay.sh b/scripts/stop-replay.sh new file mode 100755 index 0000000..d38da9c --- /dev/null +++ b/scripts/stop-replay.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +killall -SIGINT gpu-screen-recorder diff --git a/scripts/toggle-recording-selected.sh b/scripts/toggle-recording-selected.sh index 663f360..309e4d1 100755 --- a/scripts/toggle-recording-selected.sh +++ b/scripts/toggle-recording-selected.sh @@ -1,9 +1,9 @@ #!/bin/sh -e -killall -INT gpu-screen-recorder && notify-send -u low 'GPU Screen Recorder' 'Stopped recording' && exit 0; +killall -SIGINT gpu-screen-recorder && sleep 0.5 && notify-send -t 1500 -u low 'GPU Screen Recorder' 'Stopped recording' && exit 0; window=$(xdotool selectwindow) active_sink="$(pactl get-default-sink).monitor" mkdir -p "$HOME/Videos" video="$HOME/Videos/$(date +"Video_%Y-%m-%d_%H-%M-%S.mp4")" -notify-send -u low 'GPU Screen Recorder' "Started recording video to $video" +notify-send -t 1500 -u low 'GPU Screen Recorder' "Started recording video to $video" gpu-screen-recorder -w "$window" -c mp4 -f 60 -a "$active_sink" -o "$video" |