Redesign screen capture option

Use desktop portal capture option which allows capturing monitors
connected to external gpus (common on laptops with dedicated gpus)
and supports capturing properly when hdr is enabled.

Desktop portal capture allows selecting capture of a window, monitor
or screen region.

Add -fallback-cpu-encoding yes to use cpu encoding if the system
doesn't support gpu encoding. Ideally omarchy should install vaapi
drivers which would fix this issue for most users, but some users
have a gpu that dont support gpu encoding at all so this option is still
needed.

Use pgrep with ^ as is done in waybar indicator screen-recording.sh
to only grep for gpu-screen-recorder program.

Update omarchy-menu to reflect not selecting region/display capture
and instead allow capturing only desktop audio or desktop + microphone
audio.

Fixes #3367 and #3303
This commit is contained in:
dec05eba
2025-11-14 13:42:24 +01:00
committed by Ryan Hughes
parent cb869457c4
commit 128a6125a9
2 changed files with 26 additions and 54 deletions

View File

@@ -112,12 +112,10 @@ show_screenshot_menu() {
}
show_screenrecord_menu() {
case $(menu "Screenrecord" " Region\n Region + Audio\n Display\n Display + Audio\n Display + Webcam") in
*"Region + Audio"*) omarchy-cmd-screenrecord region --with-audio ;;
*Region*) omarchy-cmd-screenrecord ;;
*"Display + Audio"*) omarchy-cmd-screenrecord output --with-audio ;;
*"Display + Webcam"*) omarchy-cmd-screenrecord output --with-audio --with-webcam ;;
*Display*) omarchy-cmd-screenrecord output ;;
case $(menu "Screenrecord" " With desktop audio\n With desktop + microphone audio\n With desktop + microphone audio + webcam") in
*"With desktop audio"*) omarchy-cmd-screenrecord --with-desktop-audio ;;
*"With desktop + microphone audio"*) omarchy-cmd-screenrecord --with-desktop-audio --with-microphone-audio ;;
*"With desktop + microphone audio + webcam"*) omarchy-cmd-screenrecord --with-desktop-audio --with-microphone-audio --with-webcam ;;
*) back_to show_capture_menu ;;
esac
}