Browse Source

Lookup in all directories specified by xdg specs

pull/1/merge
gapan 13 years ago
parent
commit
69c4136ada
  1. 15
      src/xdgmenumaker

15
src/xdgmenumaker

@ -6,9 +6,9 @@ import getopt
import gtk import gtk
import xdg.DesktopEntry as dentry import xdg.DesktopEntry as dentry
import xdg.Exceptions as exc import xdg.Exceptions as exc
import xdg.BaseDirectory as bd
from operator import attrgetter from operator import attrgetter
dirlist = os.listdir('/usr/share/applications')
seticon = False seticon = False
desktop = False desktop = False
@ -192,13 +192,14 @@ def sortedcategories(applist):
return categories return categories
def desktopfilelist(): def desktopfilelist():
systemdir = '/usr/share/applications' dirs = bd.xdg_data_dirs
localdir = os.path.expanduser('~/.local/share/applications')
filelist = [] filelist = []
for i in os.listdir(systemdir): for d in dirs:
filelist.append(systemdir+'/'+i) xdgdir = d+'/applications'
for i in os.listdir(localdir): if os.path.isdir(xdgdir):
filelist.append(localdir+'/'+i) for i in os.listdir(xdgdir):
if i.endswith('.desktop'):
filelist.append(xdgdir+'/'+i)
return filelist return filelist
def menu(): def menu():

Loading…
Cancel
Save