summary refs log tree commit diff
path: root/hyprland-dialog
diff options
context:
space:
mode:
Diffstat (limited to 'hyprland-dialog')
-rwxr-xr-xhyprland-dialog41
1 files changed, 41 insertions, 0 deletions
diff --git a/hyprland-dialog b/hyprland-dialog
new file mode 100755
index 0000000..06a0b2f
--- /dev/null
+++ b/hyprland-dialog
@@ -0,0 +1,41 @@
+#!/bin/sh
+while test $# -gt 0; do
+	case $1 in
+		--apptitle)
+			apptitle="$2"
+			shift;shift
+			;;
+		--text)
+			text="$2"
+			shift;shift
+			;;
+		--title)
+			title="$2"
+			shift;shift
+			;;
+		--buttons)
+			buttons="$2"
+			shift;shift
+			;;
+		*)
+			echo "Unknown option $1"
+			exit 2
+			;;
+	esac
+done
+
+first_button="$(printf "%s" "$buttons" | cut -d';' -f1)"
+set -- --ok-label "$first_button"
+while
+	buttons="$(printf "%s" "$buttons" | cut -d';' -f1 --complement)"
+	test -n "$buttons"
+do
+	set -- "$@" --extra-button "$(printf "%s" "$buttons" | cut -d';' -f1)"
+done
+#$(printf "%s" "$2" | sed 's/;$/"/g' | sed 's/;/" --extra-button "/g')
+#printf "%s" "$extra_buttons"
+echo "$@"
+
+
+# shellcheck disable=SC2086
+zenity --info --title "${title:-$apptitle}" --text "$text" "$@" && printf "%s\n" "$first_button"