summaryrefslogtreecommitdiff
path: root/screenrec.sh
diff options
context:
space:
mode:
Diffstat (limited to 'screenrec.sh')
-rwxr-xr-xscreenrec.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/screenrec.sh b/screenrec.sh
new file mode 100755
index 0000000..7629029
--- /dev/null
+++ b/screenrec.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# Wal colors dmenu
+. "${HOME}/.cache/wal/colors.sh"
+
+# Alias Dmenu
+alias give_to_dmenu='dmenu -c -nf "$color0" -nb "$color15" -sb "$color1" -sf "$color15" -fn "Iosevka-11"'
+
+# Vars
+video_output_dir="~/stf/sr"
+number_of_displays=$(xrandr | grep " connected" | wc -l)
+display_selection=$(xrandr | grep " connected" | awk '{print $1}' | give_to_dmenu -l $number_of_displays -p "Which display would you like to capture?:")
+screen_res=$(xrandr | grep "$display_selection" | grep -o '[[:digit:]]\+x[[:digit:]]\+')
+screen_coord=$(xrandr | grep "$display_selection" | grep -o '+[[:digit:]]\++[[:digit:]]')
+#output_res=$(printf "640:480\n800:600\n1024:768\n852:480\n1280:720\n1600:900\n1920:1080" | give_to_dmenu -l 7 -p "Output Resolution:")
+video_name=$(echo "" | give_to_dmenu -p Name:)
+
+# Capture
+ffmpeg -f x11grab -s $screen_res -i :0.0$screen_coord -f pulse -i default ~/stf/sr/"$video_name.mp4" \
+& dunstify " Recording video in $video_output_dir as $video_name.mp4" \
+|| dunstify "ERROR: Video is not being recorded"