-
Notifications
You must be signed in to change notification settings - Fork 0
/
d-record
executable file
·18 lines (15 loc) · 826 Bytes
/
d-record
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash
source d-var.conf
menuopts=("Record Video + Audio" "Record Webcam and screen" "Only Video" "Record Small Area in Mouse" "Kill Recording")
action=$(printf '%s\n' "${menuopts[@]}" | $D_MENU -p ' ')
command="wl-screenrec "
opts="--codec=av1"
refreshbar="pkill -RTMIN+8 waybar"
case "$action" in
"${menuopts[0]}") $command $opts --audio -f ~/screen-$(date '+%a-%d-%b@%H:%M:%S').mp4 & $refreshbar ;;
"${menuopts[1]}") d-webcam & $command $opts --audio -f ~/visual-$(date '+%a-%d-%b@%H:%M:%S').mp4 & $refreshbar ;;
"${menuopts[2]}") $command $opts -f ~/visual-$(date '+%a-%d-%b@%H:%M:%S').mp4 & $refreshbar ;;
"${menuopts[3]}") $command $opts -g "$(slurp)" -f ~/capture-$(date '+%a-%d-%b@%H:%M:%S').mp4 & $refreshbar ;;
"${menuopts[4]}") pkill -INT $command && $refreshbar ;;
*) exit 1 ;;
esac