Move it inside where it is used

This commit is contained in:
David Heinemeier Hansson 2025-08-24 16:57:41 +02:00
parent 9d355091b5
commit da7222f510

View File

@ -1,10 +1,5 @@
#!/bin/bash
if ! lspci | grep -Eqi 'nvidia|intel.*graphics' && ! command -v wl-screenrec >/dev/null; then
notify-send "Installing wl-screenrec in order to make screen recordings..."
yay -S --noconfirm wl-screenrec
fi
[[ -f ~/.config/user-dirs.dirs ]] && source ~/.config/user-dirs.dirs
OUTPUT_DIR="${OMARCHY_SCREENRECORD_DIR:-${XDG_VIDEOS_DIR:-$HOME/Videos}}"
@ -21,6 +16,11 @@ screenrecording() {
if lspci | grep -Eqi 'nvidia|intel.*graphics'; then
wf-recorder -f "$filename" -c libx264 -p crf=23 -p preset=medium -p movflags=+faststart "$@"
else
if ! command -v wl-screenrec >/dev/null; then
notify-send "Installing wl-screenrec in order to make screen recordings..."
yay -S --noconfirm wl-screenrec
fi
wl-screenrec -f "$filename" --ffmpeg-encoder-options="-c:v libx264 -crf 23 -preset medium -movflags +faststart" "$@"
fi
}