Score:0

notify-send to other user by crontab

pr flag

I have script what is running by crontab but as su, at some point is possible that it will send notify by notify-send but I want to this to specific user (login is in $2, but only one will be logged in at the same time)

I tried below lines but no works ;(

export DISPLAY=:0.0

eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)";

username=$2
pid=$(pgrep -u $username nautilus)
dbus=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$pid/environ | sed 's/DBUS_SESSION_BUS_ADDRESS=//' )
export DBUS_SESSION_BUS_ADDRESS=$dbus

Thank you for help in advance!

Score:0
pr flag

I found this and it works cool:

DISPLAY=:0 sudo -u $2 notify-send "$path not found!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.