How to create your category in the menu?

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
Post Reply
User avatar
root
Level 1
Level 1
Posts: 8
Joined: Wed Mar 13, 2019 11:57 am
Location: Russia

How to create your category in the menu?

Post by root » Thu Mar 28, 2019 6:26 pm

Hello. I want to create my category in the cinnamon's menu for the subsequent placement in it of favorite applications (those applications that I like and/or are often used).
This should work like this:
1) I edit any file here ~/.local/share/applications/*.desktop (or here /usr/share/applications/*.desktop), indicating in "Categories" the value "Favorite"
2) In the cinnamon's menu in the category "Favorite" appears the application I need

Please tell me how to do this?

--------------
I created the /usr/share/desktop-directories/Favorite.directory file

Code: Select all

[Desktop Entry]
Name=Favorite
Comment=Favorite applications
Icon=star
Type=Directory
Added this line to /etc/xdg/menus/cinnamon-applications.menu:

Code: Select all

<Menu><Name>Favorite</Name><Directory>Favorite.directory</Directory></Menu>
And added in the file /usr/share/applications/timeshift-gtk.desktop

Code: Select all

Categories=System;Favorite;
But the application did not appear in the cinnamon's menu in the category "Favorite"! Why???
-----------------

Code: Select all

$ inxi -S
System:    Host: adminka Kernel: 4.15.0-46-generic x86_64 bits: 64 Desktop: Cinnamon 4.0.10 
           Distro: Linux Mint 19.1 Tessa

User avatar
AndyMH
Level 8
Level 8
Posts: 2296
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: How to create your category in the menu?

Post by AndyMH » Thu Mar 28, 2019 6:48 pm

Have you tried the built-in menu editor? right click on menu > configure > menu > open the menu editor.
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

User avatar
root
Level 1
Level 1
Posts: 8
Joined: Wed Mar 13, 2019 11:57 am
Location: Russia

Re: How to create your category in the menu?

Post by root » Thu Mar 28, 2019 7:39 pm

Hello, AndyMH. Yes, I tried. In general,

Code: Select all

cinnamon-menu-editor
allows you to add the necessary menu items, but I wonder how to do it by editing "categories" in *.desktop files.

User avatar
roblm
Level 10
Level 10
Posts: 3306
Joined: Sun Feb 24, 2013 2:41 pm

Re: How to create your category in the menu?

Post by roblm » Fri Mar 29, 2019 2:11 pm

Try this method. Open the File Manager and go to /.local/share/desktop-directories. Create a file named
cinnamon-favorite.directory. Add these lines:

Code: Select all

[Desktop Entry]
Name=Favorite
Comment=Favorite applications
Icon=star
Type=Directory

Open the /etc/xdg/menus/cinnamon-applications.menu file as root and add this section at the bottom, above the last line:

Code: Select all

<Menu>
    <Name>Favorite</Name>
    <Directory>cinnamon-favorite.directory</Directory>
</Menu>

Open the Menu Editor. The Favorite category should be visible. To add an app, find the the app in it's category that you want to add. Select it and click the Copy button. Select the Favorite category and click the Paste button.

Add the star icon to the .icons folder.

User avatar
root
Level 1
Level 1
Posts: 8
Joined: Wed Mar 13, 2019 11:57 am
Location: Russia

Re: How to create your category in the menu?

Post by root » Fri Mar 29, 2019 6:02 pm

Hello, roblm! Cinnamon already has the star icon (you can check - locate star.png | grep icons ), but for some reason it is not used. I replaced it with the emblem-favorite icon...
I know how to implement my plans in the Menu Editor. I’m wondering how to make it work by changing the "categories" in the launch icon.

User avatar
roblm
Level 10
Level 10
Posts: 3306
Joined: Sun Feb 24, 2013 2:41 pm

Re: How to create your category in the menu?

Post by roblm » Fri Mar 29, 2019 7:00 pm

root wrote: Cinnamon already has the star icon (you can check - locate star.png | grep icons ), but for some reason it is not used.
If you want to use the star icon, then you need to copy it to the /home/your-user-name/.icons folder. Then open the Menu Editor and change the icon for the Favorite category, using the .icon folder location. Then open the
/.local/share/desktop-directories/cinnamon-favorite.directory

Check the Icon=star line. After changing a category icon in the Menu Editor with a custom icon, that line is usually changed to the full path to the icon, such as /usr/share/icons/Mint-X/actions/24/star.png
This needs to be changed back to Icon=star.

root wrote:I know how to implement my plans in the Menu Editor. I’m wondering how to make it work by changing the "categories" in the launch icon.
Perhaps this method will give you what you want. In the /etc/xdg/menus/cinnamon-applications.menu file, change the section for the Favorite category to this:

Code: Select all

<Menu>
    <Name>Favorite</Name>
    <Directory>cinnamon-favorite.directory</Directory>
    <Include>
       <All/>
    </Include>
</Menu>
Now when the Favorite category icon is selected in the menu, all the system apps will be listed. You can use the Menu Editor to hide or show apps.

User avatar
songhuijohn
Level 3
Level 3
Posts: 177
Joined: Thu Apr 28, 2016 5:00 pm
Location: Arlington, Texas USA

Re: How to create your category in the menu?

Post by songhuijohn » Sat Mar 30, 2019 8:34 pm

In stead of mucking around with files and commands you might want to try the Menu edit GUI.
- right mouse click on the Menu icon
- left mouse click on configure
- left mouse click the Menu button at the top of the panel
- left mouse click on the Open the menu editor button in the middle of the panel
- left mouse click on the New Menu button in the upper right corner of the panel
- enter the name of the new menu item you want (i.e. Favorites) and left mouse click the OK button
- then copy and paste the the items (applications) you want included in the new menu item

I have found that if you can do want you want to do via the GUI, it is always safer than mucking around with files and commands
Linux Mint 19.1 Cinnamon, Mobo MSI A68HM Grenade, AMD A8-7600, 4GIG DDR3 1600, SSD Patriot Blast 120 GB

Post Reply

Return to “Cinnamon”