From 2e874adb503ac6efcc0db6686c87b93505a4eac1 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 18 Jul 2025 20:55:28 -0700 Subject: [PATCH] Add simple screen recordings (#235) * Add simple screen recording tool * Need slurp too --- bin/omarchy-screenrecord | 14 ++++++++++++++ default/hypr/bindings/utilities.conf | 3 +++ install/desktop.sh | 1 + migrations/1752885858.sh | 2 ++ 4 files changed, 20 insertions(+) create mode 100755 bin/omarchy-screenrecord create mode 100644 migrations/1752885858.sh diff --git a/bin/omarchy-screenrecord b/bin/omarchy-screenrecord new file mode 100755 index 0000000..229f241 --- /dev/null +++ b/bin/omarchy-screenrecord @@ -0,0 +1,14 @@ +#!/bin/bash + +if pgrep -x wl-screenrec >/dev/null; then + pkill -x wl-screenrec + notify-send "Screen recording saved to ~/Videos" -t 2000 +else + region=$(slurp) || exit 1 + notify-send "Screen recording starting..." -t 1000 + sleep 1 + wl-screenrec \ + -g "$region" \ + -f "$HOME/Videos/screen-recording-$(date +'%Y-%m-%d_%H-%M-%S').mp4" \ + --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 6d49a93..353cc63 100644 --- a/default/hypr/bindings/utilities.conf +++ b/default/hypr/bindings/utilities.conf @@ -28,5 +28,8 @@ bind = , PRINT, exec, hyprshot -m region bind = SHIFT, PRINT, exec, hyprshot -m window bind = CTRL, PRINT, exec, hyprshot -m output +# Screenshots +bind = ALT, PRINT, exec, omarchy-screenrecord + # Color picker bind = SUPER, PRINT, exec, hyprpicker -a diff --git a/install/desktop.sh b/install/desktop.sh index b72c6e8..e91cb08 100644 --- a/install/desktop.sh +++ b/install/desktop.sh @@ -4,5 +4,6 @@ yay -S --noconfirm --needed \ brightnessctl playerctl pamixer wiremix wireplumber \ fcitx5 fcitx5-gtk fcitx5-qt fcitx5-configtool wl-clip-persist \ nautilus sushi ffmpegthumbnailer \ + slurp wl-screenrec \ mpv evince imv \ chromium diff --git a/migrations/1752885858.sh b/migrations/1752885858.sh new file mode 100644 index 0000000..b582c72 --- /dev/null +++ b/migrations/1752885858.sh @@ -0,0 +1,2 @@ +echo "Install slurp + wl-screenrec for new ALT+PrintScreen screen recorder" +yay -S --noconfirm --needed slurp wl-screenrec