19

Is there a utility I can use to add an icon to the Cinnamon menu which runs a user-specified command, and as a bonus, displays a user-specified icon?

specifically I'm trying to add a command to open a virtual machine directly, without having to keep the terminal open.

VirtualBox --startvm <myMachineName> --seamless

works fine with alt-F2, but I'd rather have a short-cut so I don't have to type it out.

20

You can create a .desktop file to add your command to the Cinnamon menu.

First, create a little script eg: In your home directory

  • Open your terminal and type:

    gedit /home/user/myvm.sh
    
  • Type the following:

enter image description here

  • Save the file in your home directory and change the permissions with:

    chmod 775 /home/user/myvm.sh
    
  • Then you can create a desktop file, in the terminal type:

    cd /usr/share/applications
    sudo -H gedit myvm.desktop
    
  • Add the following information:

enter image description here

  • Save the changes and make sure the .desktop has the right permissions, in the terminal type:

    sudo chmod 644 /usr/share/applications/myvm.desktop
    

You can change the information according to your needs, in this case in the field "Icon" put your path to your custom icon, and this should be visible under the Cinnamon menu in the category "System Tools" with the name "My VM".

enter image description here

If you want, you can add it to your cinnamon panel with right click in the icon "My VM" in the Menu, and then choose "add to panel"

enter image description here

  • 2
    beautiful instructions, the screenshots were not needed but very appreciated :) – ataulm Dec 23 '12 at 16:36
  • 4
    As mentioned by childno͡.de's answer, using ~/.local/share/applications won't need root privileges if you don't need to add shortcuts for all users. – jamesdlin Jun 15 '18 at 17:33
32

or you could just use the

cinnamon-menu-editor

(Also available by right clicking the start button, selecting configure and Open the menu editor.)


Tip: When adding a custom icon, be careful to locate the icon image somewhere you won't be likely to change in the future.

3

Simply create a gnome desktop link and place it in .local/share/applications/ for personal menu links.

Sigh: some installers install their desktop links into .gnome/apps/ so you might want to link them: $ ln -s .gnome/apps/*.desktop .local/share/applications/


As pointed out by @roman-raguet https://askubuntu.com/a/232083/37280 place it into /usr/share/applications for all users

As pointed out by @mockfrog https://askubuntu.com/a/800605/37280 you might create this personal entry by cinnamon-menu-editor graphical tool. Run it with sudo for all-users

1

For anyone else looking for a simpler solution, then the following offers a GUI interface for adding custom launchers to your panel:

cd /usr/share/cinnamon/applets/panel-launchers@cinnamon.org/
./cinnamon-add-panel-launcher.py
  • This is different, I think. This will add shortcuts to your panel, but not to the menu, right? – ataulm Mar 26 '15 at 14:49
  • 2
    No longer works in current version of Cinnamon. – K7AAY Jan 14 '16 at 4:58
  • 1
    Directory exists, but "cinnamon-add-panel-launcher.py" does not exist in Debian Jessie 8.6 / Cinnamon 2.2.16. – Elliptical view Nov 19 '16 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.