From 499bd644038087eaf4ed129183659b6de61201ed Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Wed, 24 Jul 2024 16:36:46 +0100 Subject: [PATCH] Add x11 screen record function for aliases. --- bash_aliases | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/bash_aliases b/bash_aliases index 262dd1b..71d204c 100644 --- a/bash_aliases +++ b/bash_aliases @@ -8,6 +8,7 @@ alias waydroid-stop="waydroid session stop" alias waydroid-launch="weston-phone && waydroid-start & read && waydroid-stop" alias show-waydroid="waydroid-show" alias swd="waydroid-show" +alias launch-waydroid="waydroid-launch" alias screen-off="xset dpms force off" alias boot-sign-verify="sudo sign-boot && sudo verify-boot" function kernel-build() { @@ -150,3 +151,21 @@ function enable-xinput-device() { xinput enable $cdid; fi; } +function record-screen-x11() { + cwd=$(pwd); + cd ~/Videos; + mkdir -p ScreenRecordings; + cd ScreenRecordings; + srecfname="recording_"$(date '+%Y-%m-%d_%H-%M-%S')".mkv"; + if [ $# -gt 0 ]; then + srecintv="$1"; + if [ $# -gt 1 ]; then + srecfname="$2"; + fi + else + srecintv='1'; + fi + echo "Recording x11 screen to ${srecfname} every ${srecintv}s at 30 fps."; + ffmpeg -framerate "$srecintv" -f x11grab -s 1920,1080 -i :0.0+0,0 -vf settb=\(1/30\),setpts=N/TB/30 -r 30 -vcodec libx264 -crf 0 -preset ultrafast -threads 0 "$srecfname"; + cd "$cwd"; +}