blob: 169e4167bd13bd9edc070f460fd9025879ff6ec1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#!/bin/sh
get_window()
{
input="$(echo $XDPH_WINDOW_SHARING_LIST | sed 's/\[HE>\]/\n/g' | sed -E 's/\[(HC|HE)>][^[]*//g')"
choice=$(echo "$input" | mew -l 10)
printf '[SELECTION]/window:%s\n' "$choice"
}
get_screen()
{
input="$(hyprctl monitors -j | jq -r '.[].name')"
num="$(cat $input | wc -l)"
choice=$(echo "$input" | mew)
printf '[SELECTION]/screen:%s\n' "$choice"
}
get_region()
{
choice="$(slurp -f "%o@%X,%Y,%w,%h")"
printf '[SELECTION]/region:%s\n' "$choice"
}
type=$(printf "screen\nwindows\nregion" | mew -p "Choose what to screenshare:")
case "$type" in
"screen")
get_screen
;;
"windows")
get_window
;;
"region")
get_region
;;
*)
exit 1
;;
esac
|