aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/start-recording.sh5
-rw-r--r--src/main.cpp2
2 files changed, 6 insertions, 1 deletions
diff --git a/scripts/start-recording.sh b/scripts/start-recording.sh
new file mode 100755
index 0000000..455065e
--- /dev/null
+++ b/scripts/start-recording.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+pidof -q gpu-screen-recorder && exit 1
+video="$HOME/Videos/$(date +"Video_%Y-%m-%d_%H-%M-%S.mp4")"
+gpu-screen-recorder -w screen -f 60 -a "$(pactl get-default-sink).monitor" -o "$video"
diff --git a/src/main.cpp b/src/main.cpp
index 19a885f..760dcd6 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2571,7 +2571,7 @@ int main(int argc, char **argv) {
} else {
if(replay_buffer_size_secs == -1) {
char directory_buf[PATH_MAX];
- strcpy(directory_buf, filename);
+ snprintf(directory_buf, sizeof(directory_buf), "%s", filename);
char *directory = dirname(directory_buf);
if(strcmp(directory, ".") != 0 && strcmp(directory, "/") != 0) {
if(create_directory_recursive(directory) != 0) {