goodstyle
Joined: 27 Oct 2005 Posts: 393
小企鹅: 238
|
Posted: 2006-May-12 Fri, pm1:08 |
|
Post subject: [转]fluxbox菜单转fbpanel菜单脚本 |
|
fluxbox菜单转fbpanel菜单脚本- -
#!/bin/bash
# a shell script for format fluxbox menu to fbpanel menu
# author: yancy
# version: 0.2
# history: 0.2 2004/12/30 fix some bug caused by fluxbox macro
# 0.1 2004/12/29 a workable version created
# usage: ./genmenu.sh fbmenu //This will create a fbpanel menu file
# //called fbpanel_menu
sed -e \
'/#/d
/\[begin\]/{
s/\[begin\]//
s/(.*)/\ntype = menu\nconfig {\n/
}
/\[exec\]/{
s/\[exec\]//
s/(\(.*\)) {\(.*\)}/\nitem {\n\tname = \1\n\taction = \2\n}/
}
/\[submenu\]/{
s/\[submenu\]//
s/(\(.*\))/\nmenu {\n\tname = \1\n/
}
s/\[end\]/}/
/\[/d' $1 > fbpanel_menu.tmp
sed -e '/{.*}/d' fbpanel_menu.tmp > fbpanel_menu
rm -f fbpanel_menu.tmp
http://freearena.blogchina.com/465028.html |
|