Skip to content

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

Troubleshooting graphics startup

If Qt fails to start with messages like:

qt.qpa.wayland: EGL not available
QRhiGles2: Failed to create context
Failed to initialize graphics backend for OpenGL.

run ioqml with Qt Quick's software renderer:

ioqml --software-rendering examples/pass-prompt.qml

or, if you cannot change the command line used by a caller:

QT_QUICK_BACKEND=software ioqml examples/pass-prompt.qml

This avoids the default OpenGL path, which needs a working EGL/OpenGL stack on Wayland. If you specifically want hardware rendering and have XWayland available, this may also work:

QT_QPA_PLATFORM=xcb 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

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages