modified: flake.nix

This commit is contained in:
Gregory Bednov 2026-03-08 02:43:03 +03:00
commit a628d1a108

View file

@ -335,36 +335,6 @@ ${pkgs.ffmpeg}/bin/ffmpeg \
-preset ultrafast \
"$outfile" >/dev/null 2>&1 &
echo $! > "$pidfile"
'';
recordRegion = pkgs.writeShellScript "record-region"
''
set -eu
mkdir -p "$HOME/.cache" ${videoDir}
pidfile="$HOME/.cache/mirea-screenrecord.pid"
if [ -f "$pidfile" ] && kill -0 "$(cat "$pidfile")" 2>/dev/null; then
kill -INT "$(cat "$pidfile")"
rm -f "$pidfile"
exit 0
fi
read -r X Y W H <<EOF
$(${pkgs.slop}/bin/slop -f "%x %y %w %h")
EOF
outfile="$HOME/Videos/ScreenRecords/$(date +%F-%H-%M-%S).mkv"
${pkgs.ffmpeg}/bin/ffmpeg \
-f x11grab \
-video_size "${W}x${H}" \
-framerate 30 \
-i "${DISPLAY}+${X},${Y}" \
-c:v libx264 \
-preset ultrafast \
"$outfile" >/dev/null 2>&1 &
echo $! > "$pidfile"
'';
@ -402,9 +372,6 @@ case "$choice" in
"Record: whole screen (start/stop)")
exec ${recordFullScreen}
;;
"Record: region (start/stop)")
exec ${recordRegion}
;;
*)
exit 0
;;
@ -503,4 +470,4 @@ mkdir -p "$HOME/Pictures/Screenshots" "$HOME/Videos/ScreenRecords" "$HOME/.cache
packages.x86_64-linux.xcape = xcapeWrapped;
defaultPackage.x86_64-linux = resethome;
};
}
}