Skip to content

amkhlv/ioqml

Repository files navigation

Description

ioqml is a Zenity-like universal GUI dialog, but QML-based.

It accepts some commands on stdin and prints results to stdout.

Example of invocation

echo '{"prompt":"please enter passphrase and press Enter"}' | ioqml examples/pass-prompt.qml

Accepted commands

The commands incoming on stdin should be newline-separated . The following are understood as commands:

  1. Single word stop : terminates the program

  2. Single word hide : hides the window

  3. Single word show : shows the window (if it was hidden); more precisely, restores the window to its "default visibility"

  4. JSON string of the form, for example {"x": {"y":0, "z":1}} sets the object st.x inside QML to {"y":0, "z":1}. The object st is pre-defined in the header of the QML file; its property x should be declared in the QML file (or you get error). Then setting st.x can be hooked to some useful action by writing an on-property-change handler

See examples of QML files.

Do not push pretty-printed JSON on stdin, because, remember, newline is the command separator; all incoming JSON should be onelines.

To generate output

Emitting the QML signal putStr(x) prints x to stdout (see examples).

To change WM_CLASS of the ioqml window

invoke with flags, e.g. :

ioqml --name MYNAME --class MYCLASS   myapp.qml

--- sets res_name to MYNAME and res_class to MYCLASS

(Notice that --name works for all Qt applications, starting from Qt 5.2)

About

A Zenity-like GUI dialog based on QML

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published