Error when trying to reload genmon using root
Submitted by Yaron Shahrabani
Assigned to Nick Schermer
Created attachment 7293 An error message as described in the bug report.
Hello, TL;DR: I was trying to refresh genmon on xfce-panel running on my user using root and failed with a non explanatory error message, I'm trying to do this so I can refresh genmon display using udev.
Long version: First I would like to present my goal, I'm a Manjaro user: I want to have a genmon item showing me the current battery status for my phone connecting via USB cable with adb (debug mode enabled).
I configured my genmon correctly, I even have error handling mechanism for when my device is being disconnected and the "adb shell" command would fail.
And then I realized I want more, I want the genmon script to be refreshed when I'm plugging or unplugging my device so I wrote a simple udev script, I think now is the right time to mention that the udev scripts are running as the "root" user.
So I tried refreshing my genmon display using this command: /usr/bin/xfce4-panel --plugin-event=genmon-10:refresh:bool:true But it didn't work.
So I tried switching to root and then running this command again to simulate the udev environment, the command failed due to missing display so I added --display=:0.
Now I got a "protocol undefined" so I switched to my user with su so the command looks something like: su yaron -c "/usr/bin/xfce4-panel --plugin-event=genmon-10:refresh:bool:true --display=:0" Now I'm getting a dialog with the following details: Title: Failed to send D-Bus message Message body: Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead (Screenshot attached).
I Googled the issue and on some bug reports devs were saying this is a really old version so I tried looking at the version myself. So apparently I'm using the latest version: xfce4-panel 4.12.1 (Xfce 4.12)
Copyright (c) 2004-2011 The Xfce development team. All rights reserved.
Please report bugs to http://bugzilla.xfce.org/.
If I'm doing something wrong please tell me, if there's something I can fix myself I'd love that.