def get_items(self): # If we set proper desktop environment # We get exactly the apps shown in the menu, # as well as the preference panes desktop_type = __kupfer_settings__["desktop_type"] desktop_app_info_set_desktop_env(desktop_type) # Add this to the default whitelist = set([ # if you set/reset default handler for folders it is useful "nautilus-folder-handler.desktop", # we think that these are useful to show "eog.desktop", "evince.desktop", "gnome-about.desktop", "gstreamer-properties.desktop", "notification-properties.desktop", ]) blacklist = set([ "nautilus-home.desktop", ]) for item in app_info_get_all(): id_ = item.get_id() if id_ in whitelist or (item.should_show() and not id_ in blacklist): yield AppLeaf(item)
def get_items(self): # If we set proper desktop environment # We get exactly the apps shown in the menu, # as well as the preference panes desktop_type = __kupfer_settings__["desktop_type"] desktop_app_info_set_desktop_env(desktop_type) # Add this to the default whitelist = [] for item in app_info_get_all(): if item.should_show() or item.get_id() in whitelist: yield AppLeaf(item)
def get_items(self): # If we set proper desktop environment # We get exactly the apps shown in the menu, # as well as the preference panes desktop_type = __kupfer_settings__["desktop_type"] desktop_app_info_set_desktop_env(desktop_type) # Add this to the default # if you set/reset default handler for folders it is useful whitelist = set(["nautilus-folder-handler.desktop"]) for item in app_info_get_all(): if item.should_show() or item.get_id() in whitelist: yield AppLeaf(item)
def get_applications(): logging.info("open-command: Loading application shortcuts") # Add this to the default whitelist = set([ # if you set/reset default handler for folders it is useful "nautilus-folder-handler.desktop", # we think that these are useful to show "eog.desktop", "evince.desktop", "gnome-about.desktop", "gstreamer-properties.desktop", "notification-properties.desktop", ]) blacklist = set([ "nautilus-home.desktop", ]) result = [] if DESKTOP_ENVIRONMENT: desktop_app_info_set_desktop_env(DESKTOP_ENVIRONMENT) isabs = os.path.isabs isfile = os.path.isfile islink = os.path.islink with gtk_lock: for item in app_info_get_all(): id_ = item.get_id() if id_ in whitelist or (item.should_show() and id_ not in blacklist): name = item.get_name().lower() filepath = item.get_executable() shortcut_filename = None try: shortcut_filename = item.props.filename except: try: shortcut_filename = item.get_property("filename") except: try: shortcut_filename = item.get_filename() except: pass #print filepath,";",item.get_commandline(),";",item.get_description() # Need to check for existence of the file, as sometimes the app does not disappear from the list if not ptoperly uninstalled if filepath and filepath.strip() != "": if isabs(filepath): if not (isfile(filepath) or islink(filepath)): continue else: if not find_executable(filepath): continue applications_dict[name] = item s_type = shortcuts.SHORTCUT_TYPE_EXECUTABLE # get_shortcut_type(filepath) shortcut = shortcuts.Shortcut( name, s_type, filepath.strip(), shortcut_filename=shortcut_filename, category=SHORTCUT_CATEGORY) result.append(shortcut) #print "\n".join(sorted(str(s) for s in result)) logging.info("open-command: Loaded %d application shortcuts" % len(result)) return result