determine a display used by gnome-session

Jeff Hanson jhansonxi at
Sat Dec 31 15:08:00 UTC 2011

On Sat, Dec 31, 2011 at 9:51 AM, Jeff Hanson <jhansonxi at> wrote:
> I suggest using notify-send as root to send the message unless you
> need to check some kind of response from the user.

Here is a bit of code I use:
for xttypid in $(ps a o pid= o tty= | sed -n
    export DISPLAY=$(sed -n
    /usr/bin/notify-send \
    --urgency="$1" \
    --category="$2" \
    --icon="$3" \
    --expire-time="$4" \
    "$5" "$6" 2>/dev/null

More information about the Ubuntu-devel-discuss mailing list