LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 502|回复: 2

GNOME应用程式菜单

[复制链接]
发表于 2009-3-13 16:41:02 | 显示全部楼层 |阅读模式
请问有人知道如何可以在terminal內列印出GNOME应用程式的菜单?可以是任何形式的plain text。基本上我需要一个分析/usr/share/applications/然後在terminal印出类似如下(或其他格式如xml):

  1. Applications
  2. ...
  3. >Office
  4. >>OpenOffice.org Writers
  5. >>OpenOffice.org Calc
  6. ...
  7. >Internet
  8. >>Pidgin
  9. >>Firefox
复制代码
发表于 2009-3-13 17:31:01 | 显示全部楼层
gnome的菜单应该比/usr/share/applications里面的多

cat /usr/share/applications/*/* ~_~

find /usr/share/applications -exec cat {} \;
回复 支持 反对

使用道具 举报

发表于 2009-3-13 17:51:41 | 显示全部楼层
for file in `find /usr/share/applications/ -name *desktop`
do
        name=`sed -n 's/Name=//gp' $file`
        cate=`sed -n 's/Categories=//gp' $file | sed -e 's/GNOME;//g' -e 's/GTK;//g' | awk -F ";" '{print $1}'`
        [ ! -z $cate ] && echo "$cate -> $name"
done | sort
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表