How to quickly create a Launcher entry for a certain command, e.g. sudo <command>
?
I remember older Linux (Ubuntu and others) distributions where I could right-click the panel (or desktop) and select "Create Launcher".
How to quickly create a Launcher entry for a certain command, e.g. sudo <command>
?
I remember older Linux (Ubuntu and others) distributions where I could right-click the panel (or desktop) and select "Create Launcher".
You can use Unity Laucher Editor to create and modify launcher icons using only a GUI. Keep in mind that the status of this application is experimental; expect some glitches.
To install it, run the following command from a terminal:
sudo apt-get install bzr && cd && bzr branch lp:unity-launcher-editor
Once installed, you can run it by pressing Alt + F2 and executing
~/unity-launcher-editor/ule
Install gnome-panel using the Software Center or with the command
sudo apt-get install gnome-panel
Press Alt + F2 and execute the command
gnome-desktop-item-edit --create-new ~/.local/share/applications
Depending on the application, choose either Application and gksudo <command>
or Application in terminal and sudo <command>
.
Open Nautilus, press Ctrl + L and go to
~/.local/share/applications
Drag the newly created .desktop file to the launcher.
Search for the launcher icon's .desktop file; it's usually in one one these two folders:
~/.local/share/applications
/usr/share/applications
Press Alt + F2 and execute the command
gedit <.desktop file>
Add the following line to [Desktop Entry].
Actions=sudo;
If an Actions=
line already exists, append sudo;
to it.
At the end of the file, add the following:
[Desktop Action sudo]
Name=Run as Root
Exec=gksudo <command>
Save the modified .desktop file in ~/.local/share/applications
. If the original file is in a different folder, remove the old launcher icon (right-click, Unlock from Launcher) and drag the new file to the launcher.
~/.gnome/apps
also seems to contain similar .desktop
files. Is this for backward compatibility?
gnome-desktop-item-edit --create-new ~/.local/share/applications
, but unfortunately, it fails to launch. :( Other commands like gksudo truecrypt
work.
~/.gnome
directory on my computer... 2. Try to run it from a terminal to see why it fails.