Unclutter by overriding Package Menu?


#1

Hello DamnedScholar and members. :smiley:

Is there a way to override the functionality of the menu items in Config.CSON / Stylesheet.LESS as you would text size / font / background colour ++?

The current PACKAGE menu is cluttered and I would love to organise it somewhat. I would even suggest that the ATOM Package creators think about creating and adopting a sub-menu organisation structure. It can be a community curated recommendation and specification (think PEP8 / PEP257 / ++).

[picture follow in next post]

I would think a good place to start is understanding how Atom grabs all the “Menu” information to compile the menu structure as we see it in Atom.

Any ideas or thoughts where to start looking for answers?

  • Dan Padric

#2

Work-around:


#3

There’s no good way to do this. It’s possible to completely hijack the menu and only display what you want, but it’s not a simple thing. Maybe a package could be written to make it simpler for users, but I haven’t explored that.


#4

The link you gave does not seem to be helpful for this purpose… but it is where I would expect it to be. Perhaps there are other commands not published in the public API documents that might be able to do what you suggest.

I would even think of stepping up to develop a Package. But to commit to something like that as a n00b is asking for trouble.

Atom is probably finitely configurable. Maybe I’ll just have to keep my OCD in check… or customize all Packages. OR make a feature request to extend the API.

Nice chatting to you.


#5

Oh, it’s helpful, but like I said, it’s not simple. To see what I mean, open the developer console and type atom.menu in. It will show you an object that you can expand. Expand template, then 5, then submenu. If you expand 0 from there, you should see label: "Atom Beautify", and you can expand its submenu to see its specific items.


#6

I apologise; I stand corrected. What you mention is something to explore and build on. I will have to see if these items can be manipulated.

Inner look:
Source: Atom Menu Manager

Many thanks!!


#7

How might I introduce an additional submenu layer … for “package groups” … as suggested earlier (a year ago)?

My Packages menu is too long and sorted in alphabetical order.

I can see the Packages menu arrays in Developer console.

console.table(atom.menu.template[5].submenu}


#8

If you really want to, it’s possible to completely rewrite the menu you see. It’ll require some JavaScript, and you’ll first have to make some decisions about how you want to sort the packages (there’s not really a clear way to sort packages in categories). The procedure will operate in a specific sequence, regardless of how you go about it:

  1. Look up atom.menu.template and store it in a variable.
  2. Make your changes to the object stored in the variable, to reorganize or change submenu settings.
  3. Run atom.menu.clear() and then atom.menu.add(), passing in your tweaked menu object.