Xdialog clone for Haiku
This tool can be used to display GUI dialogs from shell scripts.
$ git clone git@github.com:atalax/hdialog.git
$ cd hdialog
$ make OBJ_DIR=objects
$ cp objects/hdialog ~/config/non-packaged/bin/
Usage:
hdialog <type> [arguments]...
Display a GUI dialog.
--help display this help
-w, --width width of the dialog
-h, --height height of the dialog
-t, --title title of the window
-m, --modal set the type of the window to modal
Dialog types:
--info text...
--input text...
--status text...
--radio text opt1 opt2 opt3...
--checkbox text opt1 opt2 opt3...
--status text...
--color text...
GitHub: https://github.com/atalax/hdialog
You can create standard alert
-like dialogs:
$ hdialog -m --info "Finished downloading all files."
$ hdialog -m --yesno "Do you really want to delete ~ ?"
Ask for textual input:
$ hdialog -m --input "Hello, what's yout name? :)"
You can also do selections from multiple items:
$ hdialog -m --radio "Which is your favourite color?" Red Yellow Green Orange Blue
Or pick color:
$ hdialog -m --color Choose the color of your pony:
You can remove the -m switch and get the standard non-modal window look:
$ hdialog --title Animals --checkbox "Which of the following are animals?" House Cow Dog Pencil Cat
The results are then returned using the standard output.
For displaying progress, --status
can be used:
$ hdialog -m -h 70 -w 300 --status Downloading...
You can control the status bar by piping percentages to stdin and terminate it by quit
like this:
$ (for x in $(seq 0 100); do echo $x; sleep 0.1; done; echo quit) | hdialog --status Counting...