Skip to content

Conversation

@dnalor
Copy link

@dnalor dnalor commented Mar 1, 2021

  • added DesktopEntry class to create a menu item from a .desktop file
  • create_appmenu_flat /create_appmenu_categories function to create a menu from a directory of .desktop files (flat or hierarchical by app category)

@miphreal
Copy link
Owner

miphreal commented Mar 2, 2021

@dnalor, thanks for your contribution

The idea of generating menu based on *.desktop files definitely makes sense.

I'll be quite busy this week, sorry in advance that the code review may take longer than expected.

Meantime I've got a couple suggestions:

  • would be great to use spaces instead of tabs (ideally, would be great to apply black code formatter to rofi_menu/contrib/desktopentry.py)
  • we can use python's glob or even better Path.glob for walking through the file tree

@dnalor
Copy link
Author

dnalor commented Mar 3, 2021

While I can easily replace os.walk with Path.glob, I'm not sure I see the point - a quick benchmark suggests Path.glob is slower.
Finding all *.h files in /usr/include and /usr/local/include:
walk: 10494 files: 0.072s / glob: 10494 files :0.194s

Admittedly, for this use case performance is probably irrelevant, but still...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants