aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/dmenuscreenshare
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/dmenuscreenshare')
-rwxr-xr-x.local/bin/dmenuscreenshare40
1 files changed, 40 insertions, 0 deletions
diff --git a/.local/bin/dmenuscreenshare b/.local/bin/dmenuscreenshare
new file mode 100755
index 0000000..f94f00b
--- /dev/null
+++ b/.local/bin/dmenuscreenshare
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+get_window()
+{
+ input="$(echo $XDPH_WINDOW_SHARING_LIST | sed 's/\[HA>\]/[HA>]\n/g')"
+ choice=$(echo "$input" | mew -l 10)
+ printf '[SELECTION]r/window:%s\n' "$choice"
+ echo $XDPH_WINDOW_SHARING_LIST > ~/test
+}
+
+get_screen()
+{
+ input="$(hyprctl monitors -j | jq -r '.[].name')"
+ num="$(cat $input | wc -l)"
+ choice=$(echo "$input" | mew)
+ printf '[SELECTION]r/screen:%s\n' "$choice"
+}
+
+get_region()
+{
+ choice="$(slurp -f "%o@%X,%Y,%w,%h")"
+ printf '[SELECTION]r/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