Wrong menu entry in KDE, needs gksu

Bug #234323 reported by Hervé Fache
4
Affects Status Importance Assigned to Milestone
Moblin Image Creator
Confirmed
Wishlist
Praj

Bug Description

Shortcut in K menu for Image Creator calls gksu. It should call kdesu instead.

Note: another ugly way to solve this would be for moblin-image-creator to depend on gksu.

Revision history for this message
Praj (prajwal-linux) wrote :

Is there a programmatic way to determine (at install time) if the user is running gnome or kde?

Revision history for this message
Loïc Minier (lool) wrote :

You could have a wrapper around gksu or kdesu running one or the other depending on the current session; such a wrapper is provided in the menu package, but you don't want to pull that, it changes gnome menus.

The "update-manager" utility which is used in both KDE and GNOME in Ubuntu calls gksu; this is what I'd recommend for now with a dep on gksu.

Revision history for this message
Hervé Fache (rvfh) wrote : Re: [Bug 234323] Re: Wrong menu entry in KDE, needs gksu

There should really be some simple wrapper to remove this issue!

#!/bin/sh

if [ -x /usr/bin/gksu ]; then
  /usr/bin/gksu $@
elif [ -x /usr/bin/kdesu ]; then
  /usr/bin/kdesu $@
else
  echo "What the h...?" >&2
fi

Revision history for this message
Loïc Minier (lool) wrote :

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.)

Revision history for this message
Hervé Fache (rvfh) wrote :

To detect a KDE session, you can use KDE_FULL_SESSION. This said, you
may still want to use kdesu in Gnome or gksu in KDE sessions when
that's the only thing you've got... I suppose XFCE uses gksu too, so
that should be the default. So:

if kdesu and (KDE or ! gksu)
  kdesu
else
  use gksu

Revision history for this message
Yu Ping (ping-y-yu) wrote :

yes, agree, this might be a correct solution.

Praj (prajwal-linux)
Changed in moblin-image-creator:
assignee: nobody → prajwal-linux
importance: Undecided → Wishlist
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.