aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-01-24 21:05:04 +0100
committerdec05eba <dec05eba@protonmail.com>2024-01-24 21:05:04 +0100
commitc70c0c18bd57bc139b993c2fdf09055cf8f0acda (patch)
tree6858c300a1934348dac5f2a644b4c69f73369687 /scripts
parentbbf509caf2dbf355ebc3d68ecc1b84e7669f195f (diff)
Add example scripts to save recording in application specific directory
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/record-application-name.sh5
-rwxr-xr-xscripts/replay-application-name.sh5
-rwxr-xr-xscripts/replay.sh2
-rwxr-xr-xscripts/start-replay.sh2
4 files changed, 12 insertions, 2 deletions
diff --git a/scripts/record-application-name.sh b/scripts/record-application-name.sh
new file mode 100755
index 0000000..723d067
--- /dev/null
+++ b/scripts/record-application-name.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+window=$(xdotool selectwindow)
+window_name=$(xdotool getwindowclassname "$window" || xdotool getwindowname "$window" || echo "game")
+gpu-screen-recorder -w screen -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/replay-application-name.sh b/scripts/replay-application-name.sh
new file mode 100755
index 0000000..ada517c
--- /dev/null
+++ b/scripts/replay-application-name.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+window=$(xdotool selectwindow)
+window_name=$(xdotool getwindowclassname "$window" || xdotool getwindowname "$window" || echo "game")
+gpu-screen-recorder -w screen -f 60 -c mkv -a "$(pactl get-default-sink).monitor" -r 60 -o "$HOME/Videos/replay/$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/start-replay.sh b/scripts/start-replay.sh
index 29ff67a..e36d59d 100755
--- a/scripts/start-replay.sh
+++ b/scripts/start-replay.sh
@@ -2,4 +2,4 @@
video_path="$HOME/Videos"
mkdir -p "$video_path"
-gpu-screen-recorder -w screen -f 60 -a "$(pactl get-default-sink).monitor" -c mp4 -r 30 -o "$video_path"
+gpu-screen-recorder -w screen -f 60 -a "$(pactl get-default-sink).monitor" -c mkv -r 30 -o "$video_path"