Quickly create an entry in the side bar Launcher

6,508

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

screenshot

Traditional approach

Create a new launcher item

  1. Install gnome-panel using the Software Center or with the command

    sudo apt-get install gnome-panel
    
  2. Press Alt + F2 and execute the command

    gnome-desktop-item-edit --create-new ~/.local/share/applications
    
  3. Depending on the application, choose either Application and gksudo <command> or Application in terminal and sudo <command>.

  4. Open Nautilus, press Ctrl + L and go to

    ~/.local/share/applications
    
  5. Drag the newly created .desktop file to the launcher.

Add a command to an existing launcher item

  1. Search for the launcher icon's .desktop file; it's usually in one one these two folders:

    ~/.local/share/applications
    /usr/share/applications
    
  2. Press Alt + F2 and execute the command

    gedit <.desktop file>
    
  3. Add the following line to [Desktop Entry].

    Actions=sudo;
    

    If an Actions= line already exists, append sudo; to it.

  4. At the end of the file, add the following:

    [Desktop Action sudo]
    Name=Run as Root
    Exec=gksudo <command>
    
  5. 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.

Share:
6,508

Related videos on Youtube

Mike L.
Author by

Mike L.

Updated on September 18, 2022

Comments

  • Mike L.
    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
      Dennis about 11 years
      Do you mean add a second command to a pre-existing Launcher entry or a new entry?
    • Mike L.
      Mike L. about 11 years
      Adding it for a new command is sufficient.
  • Mike L.
    Mike L. about 11 years
    Thank you very much. One related question: ~/.gnome/apps also seems to contain similar .desktop files. Is this for backward compatibility?
  • Mike L.
    Mike L. about 11 years
    I'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 like gksudo truecrypt work.
  • Mike L.
    Mike L. about 11 years
    Regarding 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
    Dennis about 11 years
    Interesting. 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.