summaryrefslogtreecommitdiff
path: root/screenrec
diff options
context:
space:
mode:
Diffstat (limited to 'screenrec')
-rwxr-xr-xscreenrec15
1 files changed, 15 insertions, 0 deletions
diff --git a/screenrec b/screenrec
new file mode 100755
index 0000000..31c6720
--- /dev/null
+++ b/screenrec
@@ -0,0 +1,15 @@
+#!/bin/dash
+
+stop_ffmpeg() {
+ pkill -f "ffmpeg -v quiet -f x11grab -video_size 1920x1080 -i :0.0"
+ exit
+}
+
+
+# Check if argument is provided
+if [ "$1" = "stop" ]; then
+ stop_ffmpeg
+fi
+
+# Start ffmpeg screen recording
+ffmpeg -v quiet -f x11grab -video_size 1920x1080 -i :0.0 "$HOME/pic/screenrec_$(date +"%Y%m%d_%H%M").mp4"