After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 525596 - using --listen with --notification, icon command does not work when piped
using --listen with --notification, icon command does not work when piped
Status: RESOLVED FIXED
Product: zenity
Classification: Core
Component: general
2.20.x
Other All
: Normal normal
: ---
Assigned To: Zenity Maintainers
Zenity Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-04-01 17:35 UTC by Robert Van Gorkom
Modified: 2014-10-21 09:26 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
Don't quit zenity when the input stream is closed (975 bytes, patch)
2010-02-27 14:39 UTC, Emilio Pozuelo Monfort
none Details | Review

Description Robert Van Gorkom 2008-04-01 17:35:55 UTC
Please describe the problem:
echo -e "icon:info" | zenity --notification --listen WORKS, but the icon in the notification area disappears

echo -e "icon:mycustom.png" | zenity --notification --listen DOES NOT work


Steps to reproduce:
1. See description.


Actual results:


Expected results:
echo -e "icon:homer.png" | zenity --notification --listen

(zenity:13465): GdkPixbuf-CRITICAL **: gdk_pixbuf_new_from_file_at_scale: assertion `width > 0 || width == -1' failed

(zenity:13465): GdkPixbuf-CRITICAL **: gdk_pixbuf_new_from_file_at_scale: assertion `width > 0 || width == -1' failed

Does this happen every time?
yes

Other information:
Comment 1 Tom Tromey 2008-04-19 20:21:00 UTC
I see both these problems.

--listen is a little funny because it exits when the input pipe is
closed.  So, using it from the shell is kind of a pain IME.
You can make a notification pop up for a given length of time like this:

(echo icon:info; sleep 5) | zenity --notification --listen


The second problem I see even if the icon: line points to an existing file.
Comment 2 Emilio Pozuelo Monfort 2010-02-27 14:39:10 UTC
Created attachment 154839 [details] [review]
Don't quit zenity when the input stream is closed

From fc381b5938f7235401286d4821f03d2b05d4876a Mon Sep 17 00:00:00 2001
From: Emilio Pozuelo Monfort <pochu27@gmail.com>
Date: Sat, 27 Feb 2010 15:32:23 +0100
Subject: [PATCH] Don't quit zenity when the input stream is closed

When using --listen for a notification, zenity quits when the stream
ends. This makes it impossible to read commands from a pipe as in
`echo icon:info | zenity --notification --listen'.
Comment 3 Rainer Rehak 2011-01-03 16:37:56 UTC
You are not using it properly, this is how it works:

# open an asynchronous pipe
exec 3> >(zenity --notification --listen --text="starting...")

# echo stuff there as long as you want
echo "tooltip:What's up?" >&3
sleep 10
echo "tooltip:Nothin, I see." >&3

# close it when done
exec 3>&-
Comment 4 Emilio Pozuelo Monfort 2011-02-08 21:25:40 UTC
ping? can I commit my patch?
Comment 5 Laurent Bigonville 2014-05-23 20:42:43 UTC
Hello,

So what's the status of this bug?

The help page is showing the following:

cat <<EOH| zenity --notification --listen
message: this is the message text
EOH

Without the patch, the call is NOT blocking, with the patch it becomes blocking. What is the expected behavior here?
Comment 6 Arx Cruz 2014-08-31 10:46:26 UTC
Sorry the delay,

I will take a look on this until next weekend.
Comment 7 Arx Cruz 2014-10-21 09:26:55 UTC
Sorry the delay, I moved to another country, and had to stabilize my life before return work on gnome.
Patch is applied on master https://git.gnome.org/browse/zenity/commit/?id=fc76e0c19be22d47cf6044ca591f0e01010a1a80