1

生成 Awesome 的“应用程序”菜单

 3 years ago
source link: https://blog.lilydjwg.me/2011/9/7/generate-application-menu-for-awesome.29327.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

生成 Awesome 的“应用程序”菜单

本文来自依云's Blog,转载请注明。

Ubuntu 下,Awesome 有个叫 debian_menu 的模块,用于向 Awesome 菜单中添加一个类似于 GNOME 的“应用程序”菜单的项。然而到了 ArchLinux 下,却没这么个模块了。本来我并不太在意,但看到别人折腾后,自己又开始手痒了。

本来是准备自己用 Python 写个程序来生成的,用 pkgfile 一查,却发现有archlinux-xdg-menu这么个软件包,遂装了。原来主要是两个 Perl 脚本。其一生成各种格式的菜单配置,其二根据配置文件为指定的窗口管理器生成菜单配置文件。虽然看示例配置文件似乎不支持 Awesome,但xdg_menu --help一看却是支持 Awesome 的。

xdg_menu --format awesome > ~/.config/awesome/menu.lua

然后改下rc.lua,把这个大菜单加上就可以了:

require("menu")
mymainmenu = awful.menu({ items = { { "Awesome", myawesomemenu, beautiful.awesome_icon },
-- ...
{ "应用程序 (&A)", xdgmenu },
-- ...

截图如下:

awfulmenu.png

效果不错,只可惜没图标。

又:从 wiki 上看到,原来这菜单可以添加快捷键的,只要在相应字母前加上&符号即可。

2011年12月3日更新dlin帮忙修改了archlinux-xdg-menu,现在有图标了 ;-)

2012年5月28日更新:现在 Arch 下需要稍微修改下命令参数了:

xdg_menu --format awesome --root-menu /etc/xdg/menus/arch-applications.menu > ~/.config/awesome/menu.lua

发送到 Kindle


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK