Skycoder42 / QtAutoUpdater

A Qt library to automatically check for updates and install them
https://skycoder42.github.io/QtAutoUpdater/
BSD 3-Clause "New" or "Revised" License
757 stars 179 forks source link

In X11, use pkexec instead kdesu / gksu #22

Open ghost opened 5 years ago

ghost commented 5 years ago

pkexec is a part of polkit, it's available on Linux / BSD. And it's default privileges authorize frontend.

Skycoder42 commented 5 years ago

That sounds like a good idea. However, as I just tried this command out, it failed to start any Qt application with the following errors:

qt.qpa.xcb: could not connect to display 

After a little reseach, I found this post: https://askubuntu.com/questions/287845/how-to-configure-pkexec Apparently, we need to pass a few command line arguments to make it work. (And a quick test actually shows it working).

Do you know of any other pitfalls with pkexec that one should be aware of before using it here?

ghost commented 5 years ago

@Skycoder42 I am not sure about that, but I suggest you make the adminauthorization as a shared library.