I wouldn't recommend the above wrapper, but instead checking for session env vars. The proposed wrapper only checks what's on the system, and doesn't take into account which DE the user runs as.
sensible-browser checks whether the GNOME_DESKTOP_SESSION_ID env var is set and launches gnome-www-browser in this case. I think KDE sessions probably expose a similar env var which could be used in heuristics.
As update-manager is already using gksu in KDE sessions, I don't see much point in being too creative for this particular app. I'd rather recommend starting a wider discussion on this topic, perhaps we could come up with sensible-su-to-root or something.
(The current trend is to move programs to PolicyKit though.)
I wouldn't recommend the above wrapper, but instead checking for session env vars. The proposed wrapper only checks what's on the system, and doesn't take into account which DE the user runs as.
sensible-browser checks whether the GNOME_DESKTOP_ SESSION_ ID env var is set and launches gnome-www-browser in this case. I think KDE sessions probably expose a similar env var which could be used in heuristics.
As update-manager is already using gksu in KDE sessions, I don't see much point in being too creative for this particular app. I'd rather recommend starting a wider discussion on this topic, perhaps we could come up with sensible-su-to-root or something.
(The current trend is to move programs to PolicyKit though.)