«
»

Towards the resolution of the issues with libnotify

January 12th, 2008 by George Notaras

A while ago, I had written about some problems I had encountered while trying to send notification messages with libnotify to the logged-in users’ desktops from a cronjob. Although I haven’t made any progress with that issue, I just noticed a very useful comment under that post, submitted by Aleksei. According to the tip, sudo can be used in order to actually send the notification as the user that is currently using the desktop, for example: sudo -u $USER notify-send ... The $USER can be easily retrieved by the cronjob from the /proc/$PID/environ path. I am not able to test this at the moment, but will do (time permitting). Apart from this possible workaround with sudo, I assume that the current dbus security configuration does not permit the sending of messages using notify-send as I had described in that previous article. Anyhow, not only I do not have the necessary free time to study dbus‘ security mechanism, but, frankly, I do not wish to learn about it at the current time.

The Towards the resolution of the issues with libnotify by George Notaras, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

Tags: , ,

One Response to “Towards the resolution of the issues with libnotify”

  1. chris Says :

    hello there

    tnx for the solution, i did these script to send automated notify-messages:

    #!/bin/bash
    PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/crn/bin
    export DISPLAY=:0.0
    export $(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep gnome-session)/environ )
    TIME=$1
    shift
    /usr/bin/notify-send -t 36000 $1 $2

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre>