forked from Shinonome/dots-hyprland
Fix full-screen recording for multimonitors (#348)
This commit is contained in:
@@ -6,6 +6,9 @@ getdate() {
|
|||||||
getaudiooutput() {
|
getaudiooutput() {
|
||||||
pactl list sources | grep 'Name' | grep 'monitor' | cut -d ' ' -f2
|
pactl list sources | grep 'Name' | grep 'monitor' | cut -d ' ' -f2
|
||||||
}
|
}
|
||||||
|
getactivemonitor() {
|
||||||
|
hyprctl monitors -j | gojq -r '.[] | select(.focused == true) | .name'
|
||||||
|
}
|
||||||
|
|
||||||
cd ~/Videos || exit
|
cd ~/Videos || exit
|
||||||
if pgrep wf-recorder > /dev/null; then
|
if pgrep wf-recorder > /dev/null; then
|
||||||
@@ -16,9 +19,9 @@ else
|
|||||||
if [[ "$1" == "--sound" ]]; then
|
if [[ "$1" == "--sound" ]]; then
|
||||||
wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$(slurp)" --audio="$(getaudiooutput)" & disown
|
wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$(slurp)" --audio="$(getaudiooutput)" & disown
|
||||||
elif [[ "$1" == "--fullscreen-sound" ]]; then
|
elif [[ "$1" == "--fullscreen-sound" ]]; then
|
||||||
wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --audio="$(getaudiooutput)" & disown
|
wf-recorder -o $(getactivemonitor) --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --audio="$(getaudiooutput)" & disown
|
||||||
elif [[ "$1" == "--fullscreen" ]]; then
|
elif [[ "$1" == "--fullscreen" ]]; then
|
||||||
wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t & disown
|
wf-recorder -o $(getactivemonitor) --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t & disown
|
||||||
else
|
else
|
||||||
wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$(slurp)" & disown
|
wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$(slurp)" & disown
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user