Skip to main content
1 of 2
Nikhil Mulley
  • 8.4k
  • 34
  • 50

I think if you know the pid of the gnome session manager, then you read the environment from /proc filesystem.

GNOME_SESSION_PID=<PID_OF_GNOME_SESSION> 
READ_SESSION_COOKIE="$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$pid/environ|cut -d= -f2-)"

Use the SESSION id then, with other programs like notify-send or dbus* tools.

Cheers.

Nikhil Mulley
  • 8.4k
  • 34
  • 50