Quickly create an entry in the side bar Launcher
Unity Launcher editor
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
Traditional approach
Create a new launcher item
-
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 andsudo <command>
.-
Open Nautilus, press Ctrl + L and go to
~/.local/share/applications
Drag the newly created .desktop file to the launcher.
Add a command to an existing launcher item
-
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, appendsudo;
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.
Related videos on Youtube
Mike L.
Updated on September 18, 2022Comments
-
Mike L. over 1 year
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".
-
Dennis about 11 yearsDo you mean add a second command to a pre-existing Launcher entry or a new entry?
-
Mike L. about 11 yearsAdding it for a new command is sufficient.
-
-
Mike L. about 11 yearsThank you very much. One related question:
~/.gnome/apps
also seems to contain similar.desktop
files. Is this for backward compatibility? -
Mike L. about 11 yearsI've tried to create an item with the command
gnome-desktop-item-edit --create-new ~/.local/share/applications
, but unfortunately, it fails to launch. :( Other commands likegksudo truecrypt
work. -
Mike L. about 11 yearsRegarding Gnome - I have the standard Ubuntu 12.04 installed, so I guess, that Gnome is not installed. Launching the command from the Terminal works fine.
-
Dennis about 11 yearsInteresting. I have Ubuntu 12.04 as well. Maybe some application you installed had that path hardcoded... I've edited my answer to add a GUI-based approach.