In short:
I have a scripting finding, fixing and mounting a partition, thus this needs sudo
/ su
permissions.
System: Gnome 16.04 - amd64
notify-send "a message"
that shows a notification as expected, but
Problem:
sudo notify-send "a message"
does not show anything.
This is since it gets the current user (sudo i.e. root) and attempts to send a notification.
w
shows my current display as :1, thus
export DISPLAY=:1;
sudo notify-send "a message"
also does not show notification
(also tried DISPLAY=:0
).
I have had a look at a few posts/questions, usually those associated with cron but none of these helped.
In these answers/solutions, they are refering to the dbus
sessions, etc
I might just be misreading / misunderstanding too :p
Any suggestions?
su <dispay_username> -c 'notify-send "a message"
'