How to put gksu gedit shortcut on the launcher in unity
clanlaw at googlemail.com
Fri Nov 16 09:29:46 UTC 2012
On 16 November 2012 09:21, Colin Law <clanlaw at googlemail.com> wrote:
> On 16 November 2012 01:54, Jim Byrnes <jf_byrnes at comcast.net> wrote:
>> I have 12.04 on my laptop and am trying to get comfortable with Unity.
>> I can't figure out how to open gedit from the launcher and have it ask for
>> my password so I can edit read only files.
>> This link seemed to be what I wanted:
>> They are talking about Synaptic but I thought it may also apply to gedit.
>> The last post offers this solution.
>> After installing Synaptic, type "syn" into the Dash and drag the Synaptic
>> shortcut onto the desktop.
>> Open a gedit window and drop the shortcut into it, then change the Exec line
>> from "synaptic-pkexec" to "gksu synaptic", save and exit.
>> Get rid of any previously placed Synaptic shortcut in the launcher, then
>> drag the new, edited one from the desktop and position in the launcher as
>> Check that clicking it brings up the authentication dialog, as it should.
>> Back to normal.
>> The problem is when I open the Dash it covers the entire desktop and the is
>> no way to drop the shortcut on it.
>> Is there another way to do what I need?
> I think this is a much better way.
> In at terminal copy the gedit .desktop file (not to be confused with
> files on the Desktop) to .local/share/applications and rename it
> ggedit.desktop (or whatever).
> cp /usr/share/applications/gedit.desktop
> edit that file
> gedit .local/share/applications/ggedit.desktop
> and change the Exec line to
> Exec=gksu gksu gedit %U
> and the Name and generic name lines to something like
> Name=gksu gedit
> GenericName=Root Text Editor
> or whatever you fancy, these are the displayed names.
> I will explain why there there are two gksu commands in the Exec line
> in a moment.
> Save the file and close gedit (to avoid confusion below).
> Open nautilus hit ctrl+h to show hidden files and browse to
> Right click ggedit.desktop and on the permissions tab select Allow
> Executing ... and close the dialog.
> The file should now show as whatever you put for the Name in the
> desktop file. Double click it and it should ask for your password and
> open gedit as root.
> Right click the gedit icon on the launcher and select Lock to Launcher.
> The reason for including gksu twice in the exec command is to that it
> works around the bug that causes an extra new file tab to be opened
> when gedit is opened as root. There is a bug for this but I can't
> immediately see it at the moment.
I found it
More information about the ubuntu-users