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.