Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DesktopEntry item#5

Open
dnalor wants to merge 1 commit into
miphreal:master from
dnalor:desktopentry
Open

DesktopEntry item #5
dnalor wants to merge 1 commit into
miphreal:master from
dnalor:desktopentry

Conversation

@dnalor

@dnalor dnalor commented Mar 1, 2021

Copy link
Copy Markdown
  • 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 reacted with thumbs up emoji

miphreal commented Mar 2, 2021

Copy link
Copy Markdown
Owner

@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 commented Mar 3, 2021

Copy link
Copy Markdown
Author

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /