humdingerb / hdialog

Xdialog clone for Haiku

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hdialog

Xdialog clone for Haiku

This tool can be used to display GUI dialogs from shell scripts.

Installation

$ git clone git@github.com:atalax/hdialog.git
$ cd hdialog
$ make OBJ_DIR=objects
$ cp objects/hdialog ~/config/non-packaged/bin/

Usage

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

Examples

You can create standard alert-like dialogs:

$ hdialog -m --info "Finished downloading all files."

simple-info

$ hdialog -m --yesno "Do you really want to delete ~ ?"

yesno

Ask for textual input:

$ hdialog -m --input "Hello, what's yout name? :)"

name-input

You can also do selections from multiple items:

$ hdialog -m --radio "Which is your favourite color?" Red Yellow Green Orange Blue

radio-colors

Or pick color:

$ hdialog -m --color Choose the color of your pony:

hdialog-color

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

checkbox

The results are then returned using the standard output.

For displaying progress, --status can be used:

$ hdialog -m -h 70 -w 300 --status Downloading...

status

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...

About

Xdialog clone for Haiku

License:MIT License


Languages

Language:C++ 87.0%Language:Makefile 13.0%