I think the approach I used in my script should be sufficient: If a KDE session is running (based on $KDE_FULL_SESSION), look for kdesudo first, then for gksudo. If no KDE is running (GNOME, XFCE, ...) look for gksudo first, then kdesudo. Those are all X sudos I could find.
If a X session is running, it shouldn't really fall back to plain sudo since the user will never see the prompt if the script was called from a desktop file. Maybe I could change it such that it will fall back to sudo unless the --desktop parameter was given. Relying on $DESKTOP_SESSION is more complicated, because for example on my box it just says "default" and I'd have to go looking in some X config files to find out what that means (ie. find out which window manager I'm currently using). I tried to implement a third option with kdialog and SUDO_ASKPASS but in the end it got to error prone for a feature which is probably never used (since when kdialog is installed there will probably also kdesudo). And it seems like xdialog isn't included in Debian/Ubuntu anymore. In the end, gparted should just use PolicyKit or whatever instead of being started completely as root, but I guess it will take a while until that is the case. -- gparted menu entry depends on gksu https://bugs.launchpad.net/bugs/616274 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
