determine a display used by gnome-session

Jeff Hanson jhansonxi at
Sat Dec 31 14:51:39 UTC 2011

> From: Staszek Hodur <staho at>
> To: ubuntu-devel-discuss at
> Cc:
> Date: Fri, 30 Dec 2011 20:44:05 +0100
> Subject: determine a display used by gnome-session
> Hi all,
> I am trying to write a simple script to control the amount of time my kids are spending at the computer. Fortunately, there are no Windows, no Gates etc. :-)
> The script is supposed to run in cron. If the time is up, the script will display a message and close the session. I can get all the X sessions and all the Gnome session, say:
> # ps -fe
> ...

I suggest using notify-send as root to send the message unless you
need to check some kind of response from the user.

More information about the Ubuntu-devel-discuss mailing list