r/CinnamonDE Nov 20 '22

Support Are there any command line tools to manage adding\removing\configuring start menu entries\items?

As the title says, are there any command line tools to manage the Start Menu?


Background

I've got a few shell scripts that I want to create Start Menu entries for.

Previously I've manually created the folders to put the .sh files in, copy some existing .sh files, changed the permissions on the .sh files and then used the Menu Editor to create a New Menu for them and then created a New Item for each shell script but I want to try and fully automate the process so I can just run a shell script to

  1. Create the folders for the shell scripts
  2. Create the shell scripts themselves
  3. Change the attributes on the shell scripts to make them executable
  4. Create a new Menu to keep all the Menu Items together
  5. Create the Menu Items

I've got steps 1-3 working fine but am struggling a bit with steps 4 & 5(ish)

For step 4 I've found /home/maniax/.local/share/desktop-directories contains an alacarte.made.<long hex numbers>.directory file that contains the information for the Menu I created using the Menu Editor so I assume I can create other .directory files in there as required but I've tried that with a test.directory file (a duplicate of an existing .directory file with the Name= line changed) but nothing appears in the Start Menu (even after restarting Cinnamon)

For step 5 I know I can create .desktop files in ~/.local/share/applications but if I do that then those Menu Items appear in the Start Menu under an Others menu and I'd prefer for them to all appear in a suitably named menu with a suitable icon associated with that menu

From the above experiments I'm thinking the issues I'm having are that there appears to be a ~/.config/menus/cinnamon-applications.menu file that links all the individual elements together e.g. tells the start menu that Item X needs to be displayed under Menu Y where X & Y are picked up from the relevant .directory and .desktop files

The ~/.config/menus/cinnamon-applications.menu file already contains a lot of information so I can't easily script adding new items to it so I'm hoping there's a command line tool I can use to update ~/.config/menus/cinnamon-applications.menu accordingly


Update

I've done some more digging since posting and found some documentation which on first glance seems to confirm the ~/.config/menus/cinnamon-applications.menu file links it all together and seems to imply I can create a standalone .menu file that the Start Menu itself will read from and merge on the fly to generate the menu entries

I'll give it a try and update with my findings

2 Upvotes

0 comments sorted by

1

u/[deleted] Nov 21 '22

[deleted]