A .desktop file for gksudo

I myself probably should have looked for one of these before I made this one; it's a .desktop file for gksudo that gives you access to it from the GUI in non-incidental ways. Below the break you'll find the text, which is not very long.

[Desktop Entry]
Name=gksudo
GenericName=GNOME Privilege Elevator
Comment=graphical interface to sudo and su
X-GNOME-FullName=gksudo GNOME Privilege Elevator
Type=Application
Categories=System;
Exec=gksudo %U
TryExec=gksudo
Terminal=false
StartupNotify=false
MimeType=application/x-executable;application/x-shellscript
Icon=terminal

I cobbled this together by sniffing up other .desktop files and the /etc/mime.types file. It works here. I never actually knew that you could simply run gksudo and get a graphic (if limited) interface; you can also drop executables on top of the icon to run them. I suppose I ought to add the mime type for mono applications, but if I ever run one of those as root I should probably have my head fsck'd.

If you name this file gksudo.desktop and drop it in /usr/share/applications you'll be able to use it to open executables as root, usually via some kind of right-click menu. After doing this once most desktop environments will provide it as an association so that it becomes easier on subsequent occasions. It's a sort of poor-man's "run as Administrator", except it's actually better in that gksudo uses sudo as the backend when available and su when not, and prompts you for passwords accordingly, or not if you have been granted the right to run the command as root without a password in the sudoers file.

Add new comment

Default

  • Use [fn]...[/fn] (or <fn>...</fn>) to insert automatically numbered footnotes.
  • You may link to images on this site using a special syntax
  • Web page addresses and e-mail addresses turn into links automatically.
  • To post pieces of code, surround them with <code>...</code> tags. For PHP code, you can use <?php ... ?>, which will also colour it based on syntax.
  • Internal paths in single or double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or path. Paths to files in single or double quotes, written as "files:somefile.ext", for example, are replaced with the appropriate URL that can be used to download the file.
  • Filtered words will be replaced with the filtered version of the word.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <q>

Issue

  • Lines and paragraphs break automatically.
  • To post pieces of code, surround them with <code>...</code> tags. For PHP code, you can use <?php ... ?>, which will also colour it based on syntax.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>

Drinking Game

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <p> <br> <pre> <h2> <h3> <h4>
  • Images may be embedded like: [image:node_id align=alignment hspace=n vspace=n border=n size=label width=n height=n nolink=(0|1) class=name style=style-data node=id] Leave off any attributes you don't want.
  • [img_assist|...] tags will be displayed, maybe. Please don't make more of them.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Refresh Type the characters you see in this picture. Type the characters you see in the picture; if you can't read them, submit the form and a new image will be generated. Not case sensitive.  Switch to audio verification.