aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/screenrecord.sh
blob: 24ffdb4571cc84952399a9dc67893333ac710d53 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

# Get focused output
output="$(moocow show windows | jq -r '.data[] | select(.focused == true) | .output')"

case $1 in
	selected-region)
		# Record the selected region
        wf-recorder -g "$(slurp)" -f ~/Videos/"$(date +%Y-%m-%d_%H-%m-%s)".mkv
		;;
	focused-window)
		# Record the focused window
		geometry=$(moocow show window| jq -r '.data | "\(.x),\(.y) \(.width)x\(.height)"')
		echo "$geometry"
        wf-recorder -g "$geometry" -f ~/Videos/"$(date +%Y-%m-%d_%H-%m-%s)".mkv
		;;
	*)
		# Record the currently focused output and save it into Screenrecordings
		wf-recorder -o "$output" -f ~/Videos/"$(date +%Y-%m-%d_%H-%m-%s)".mkv
		;;
esac