Add x11 screen record function for aliases.

This commit is contained in:
Captain ALM 2024-07-24 16:36:46 +01:00
parent 86d4b283d3
commit 499bd64403
Signed by: alfred
GPG Key ID: 4E4ADD02609997B1

View File

@ -8,6 +8,7 @@ alias waydroid-stop="waydroid session stop"
alias waydroid-launch="weston-phone && waydroid-start & read && waydroid-stop" alias waydroid-launch="weston-phone && waydroid-start & read && waydroid-stop"
alias show-waydroid="waydroid-show" alias show-waydroid="waydroid-show"
alias swd="waydroid-show" alias swd="waydroid-show"
alias launch-waydroid="waydroid-launch"
alias screen-off="xset dpms force off" alias screen-off="xset dpms force off"
alias boot-sign-verify="sudo sign-boot && sudo verify-boot" alias boot-sign-verify="sudo sign-boot && sudo verify-boot"
function kernel-build() { function kernel-build() {
@ -150,3 +151,21 @@ function enable-xinput-device() {
xinput enable $cdid; xinput enable $cdid;
fi; 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";
}