From 9467ff2de361ba1fad717542efc43930304dad36 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 8 Sep 2025 13:10:26 +0200 Subject: [PATCH] Add audio recording on SHIFT to the screenrecording options --- bin/omarchy-cmd-screenrecord | 10 ++++++++-- default/hypr/bindings/utilities.conf | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/bin/omarchy-cmd-screenrecord b/bin/omarchy-cmd-screenrecord index 4abffc6..f9a604b 100755 --- a/bin/omarchy-cmd-screenrecord +++ b/bin/omarchy-cmd-screenrecord @@ -8,15 +8,21 @@ if [[ ! -d "$OUTPUT_DIR" ]]; then exit 1 fi +if [[ $2 == "audio" ]]; then + AUDIO="--audio" +else + AUDIO="" +fi + screenrecording() { filename="$OUTPUT_DIR/screenrecording-$(date +'%Y-%m-%d_%H-%M-%S').mp4" notify-send "Screen recording starting..." -t 1000 sleep 1 if lspci | grep -Eqi 'nvidia|intel.*graphics'; then - wf-recorder -f "$filename" -c libx264 -p crf=23 -p preset=medium -p movflags=+faststart "$@" + wf-recorder $AUDIO -f "$filename" -c libx264 -p crf=23 -p preset=medium -p movflags=+faststart "$@" else - wl-screenrec -f "$filename" --ffmpeg-encoder-options="-c:v libx264 -crf 23 -preset medium -movflags +faststart" "$@" + wl-screenrec $AUDIO -f "$filename" --ffmpeg-encoder-options="-c:v libx264 -crf 23 -preset medium -movflags +faststart" "$@" fi } diff --git a/default/hypr/bindings/utilities.conf b/default/hypr/bindings/utilities.conf index f591733..7694679 100644 --- a/default/hypr/bindings/utilities.conf +++ b/default/hypr/bindings/utilities.conf @@ -33,8 +33,10 @@ bindd = SHIFT, PRINT, Screenshot of window, exec, omarchy-cmd-screenshot window bindd = CTRL, PRINT, Screenshot of display, exec, omarchy-cmd-screenshot output # Screen recordings -bindd = ALT, PRINT, Screen record a region, exec, omarchy-cmd-screenrecord +bindd = ALT, PRINT, Screen record a region, exec, omarchy-cmd-screenrecord region +bindd = ALT SHIFT, PRINT, Screen record a region with audio, exec, omarchy-cmd-screenrecord region audio bindd = CTRL ALT, PRINT, Screen record display, exec, omarchy-cmd-screenrecord output +bindd = CTRL ALT SHIFT, PRINT, Screen record display with audio, exec, omarchy-cmd-screenrecord output audio # Color picker bindd = SUPER, PRINT, Color picker, exec, pkill hyprpicker || hyprpicker -a