main.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:Linalfred 作者: PeterHo 项目源码 文件源码
def getAppIcon(name):
    global appList
    iconTheme = Gtk.IconTheme.get_default()
    if not appList:
        appList = Gio.AppInfo.get_all()
    for app in appList:
        if name == Gio.AppInfo.get_display_name(app) or \
                        name == Gio.AppInfo.get_executable(app) or \
                        os.path.basename(name) == Gio.AppInfo.get_display_name(app) or \
                        os.path.basename(name) == os.path.basename(Gio.AppInfo.get_executable(app)):
            icon = Gio.AppInfo.get_icon(app)
            if icon:
                iconInfo = Gtk.IconTheme.lookup_by_gicon(iconTheme, icon, 256, Gtk.IconLookupFlags.USE_BUILTIN)
                if iconInfo:
                    return iconInfo.get_filename()
    return 'app.png'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号