Forum > LCL
popupnotifier and Qt5
dbannon:
Hmm, it looks to me like you are seeking to do something that the designers of pkexec have specifically set out to ensure you cannot do -
--- Quote ---... pkexec will not allow you to run X11 applications
as another user since the $DISPLAY and $XAUTHORITY environment
variables are not set.
--- End quote ---
My guess is you could find a specific way around that (*) but it would not be very reliable and may not work on a DE other than the one you tested it on for example. Because you are relying on libnotify and trying to fool it, any change, internally, to libnotify would break what you are doing.
(*) - I'd start by leaving a semaphore file somewhere containing DISPLAY, reading that when your app starts up and trying to poke it into the env. But, honestly, its a bad way to do things.
Actually, what I would consider doing is having a 'server' running in userspace that the root app can communicate with, then the userspace app is in charge of triggering the notification, and, perhaps, do any other user interaction necessary.
Or, do it the official way, dbus. Thats what the Gnome devs would tell you do. They like lots and lots of code....
Davo
linuxer:
I agree with all your points.
Therefore, my best shot would be by utilizing DBUS stuff (sh@t), but on this case, I will check.
Kind regards
Linuxer
linuxer:
Case solved, with notify-osd, w/o any need for dbus workaround
I just have to probably adjust the notifications position, and time, but it does the job
varianus:
Some years ago I've written this class that directly call DBUS notification api to avoid dependencies on libnotify.
It's the same thing done internally from libnotify library.
https://github.com/varianus/ovoplayer/blob/master/src/platform/unix/notification.pas
linuxer:
Thanks, I will try it!
Navigation
[0] Message Index
[*] Previous page