Skip to content

Zenity notification does not work #9

Description

@tmrlvi

When using zenity as backend, the following code fails to create a notification and hangs with the error message Could not parse command from stdin.

using Alert
alert("test")

The issue is that the --listen command expects a specific structure for the input. In the man page for older zenity version (e.g. 3.44.01), the structure is described clearly:

       --listen
              Listen for commands on stdin. Commands include 'message', 'tooltip',  'icon',
              and  'visible'  separated  by  a  colon. For example, 'message: Hello world',
              'visible: false', or 'icon: /path/to/icon'. The icon command also accepts the
              four stock icon: 'error', 'info', 'question', and 'warning'

It is the same format used in the up-to-date example on Gnome's website2.

The right way would be to use the --text option with the message right after.

Footnotes

  1. https://manpages.debian.org/bookworm/zenity/zenity.1.en.html

  2. https://help.gnome.org/users/zenity/stable/notification.html.en

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions