2024-05-12 17:08:24 -05:00
|
|
|
display=$(xrandr \
|
|
|
|
| grep ' connected' \
|
|
|
|
| awk -F ' ' '{print $1}' \
|
|
|
|
| sed '1i select rectangle' \
|
|
|
|
| fzy)
|
2023-01-15 16:48:49 -06:00
|
|
|
|
2024-05-12 17:08:24 -05:00
|
|
|
case "$display" in
|
|
|
|
"select"*)
|
|
|
|
geom=$(xrectsel)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
geom=$(xrandr \
|
|
|
|
| grep "$display" \
|
|
|
|
| awk -F ' ' '{print $3 " " $4}' \
|
|
|
|
| sed 's/primary //g' \
|
|
|
|
| awk -F ' ' '{print $1}' \
|
|
|
|
| grep '[[:digit:]]'
|
|
|
|
)
|
|
|
|
;;
|
|
|
|
esac
|
2023-01-15 16:48:49 -06:00
|
|
|
|
2024-05-12 17:08:24 -05:00
|
|
|
printf "[] selected geometry is %s\n" "$geom"
|
|
|
|
|
|
|
|
medium=$(
|
|
|
|
printf ".mp4\n.png\n" | fzy
|
|
|
|
)
|
|
|
|
|
|
|
|
printf "[] capturing in medium %s\n" "$medium"
|
2023-01-15 16:48:49 -06:00
|
|
|
|
|
|
|
case "$medium" in
|
2024-05-12 17:08:24 -05:00
|
|
|
*"mp4"*)
|
|
|
|
ffcast -g $geom rec
|
2023-01-15 16:48:49 -06:00
|
|
|
;;
|
2024-05-12 17:08:24 -05:00
|
|
|
*"png"*)
|
|
|
|
ffcast -g $geom png
|
2023-01-15 16:48:49 -06:00
|
|
|
;;
|
|
|
|
esac
|