koiuo / randrctl

Profile based screen manager for X
GNU General Public License v3.0
47 stars 12 forks source link

notify-send not always working #28

Open drws opened 3 years ago

drws commented 3 years ago

On one of my machines where MATE desktop enviromnent is used, randrctl fails to display the desktop notification on profile switch. I think it has to do with DBUS_SESSION_BUS_ADDRESS environment variable, similar to currently-implemented DISPLAY and XAUTHORITY retrieval and use. For more information please see this Wiki paragraph and this implementation should probably also be helpful.

On the same machine randrctl auto is working properly and displays the notification while sudo randrctl auto works as well, but doesn't display the notification (I'm using the system-wide configuration directory /etc/randrctl).

I have tried to manually set/export DBUS_SESSION_BUS_ADDRESS in randrctl config's post_switch hook, but couldn't get it to work. It would probably work with an intermediate shell script instead of directly calling notify-send, but I thought it might be interesting for solving in randrctl itself.