diff options
| author | Zach DeCook <zachdecook@librem.one> | 2026-02-01 22:32:28 -0500 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2026-02-01 22:32:28 -0500 |
| commit | e0f5fdd8bbf05f528fe28fc77acf7d809327b0f7 (patch) | |
| tree | 0de142bbe7ade4e47427fe9fbb257eea51fd66f7 /hyprland-dialog | |
| parent | bf55eae3fcaa7c6000fd49eabb5dcc93f3b5f16e (diff) | |
| download | hyprland-zenityutils-e0f5fdd8bbf05f528fe28fc77acf7d809327b0f7.tar.gz | |
add hyprland-dialog zachster
Diffstat (limited to 'hyprland-dialog')
| -rwxr-xr-x | hyprland-dialog | 41 |
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" |
