Tuesday, April 23, 2024
 Popular · Latest · Hot · Upcoming
25
rated 0 times [  25] [ 0]  / answers: 1 / hits: 57636  / 1 Year ago, sat, december 17, 2022, 8:43:46

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.


More From » shortcuts

 Answers
6

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


[#33547] Sunday, December 18, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
restlerfin

Total Points: 347
Total Questions: 112
Total Answers: 108

Location: Ukraine
Member since Wed, Dec 16, 2020
3 Years ago
;