Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handle OnlyShowIn and NotShowIn. #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/xdgmenumaker
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,11 @@ def get_entry_info(desktopfile, ico_paths=True):
notshowin = de.getNotShowIn()
hidden = de.getHidden()
nodisplay = de.getNoDisplay()
# none of the freedesktop registered environments are supported by
# OnlyShowIn anyway:
# http://standards.freedesktop.org/menu-spec/latest/apb.html
# So if OnlyShowIn is set, it certainly isn't for any of the WMs
# xdgmenumaker supports.
if (onlyshowin != []) or (desktop in notshowin) or hidden or nodisplay:
if 'XDG_CURRENT_DESKTOP' in os.environ and len(onlyshowin) >0 and not os.environ['XDG_CURRENT_DESKTOP'] in onlyshowin:
return None
if 'XDG_CURRENT_DESKTOP' in os.environ and len(notshowin) >0 and os.environ['XDG_CURRENT_DESKTOP'] in notshowin:
return None
if hidden or nodisplay:
return None

name = de.getName().encode('utf-8')
Expand Down