From e0f5fdd8bbf05f528fe28fc77acf7d809327b0f7 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Sun, 1 Feb 2026 22:32:28 -0500 Subject: add hyprland-dialog --- hyprland-dialog | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 hyprland-dialog (limited to 'hyprland-dialog') 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" -- cgit 1.4.1