Skip to content

Commit 0ee8030

Browse files
committed
Add contrib/example-dynamic-root-menu.sh
...because such menus are supported with the released of labwc 0.8.3 It shows how a simple wrapper can be written around labwc-menu-generator to add some menu entires before and after the generated directories and .desktop entries.
1 parent a6e96b4 commit 0ee8030

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

contrib/example-dynamic-root-menu.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/sh
2+
#
3+
# Example usage (~/.config/labwc/menu.xml):
4+
#
5+
# <?xml version="1.0" encoding="utf-8"?>
6+
# <openbox_menu>
7+
# <menu id="root-menu" label="" execute="example-dynamic-root-menu.sh"/>
8+
# </openbox_menu>
9+
10+
terminal="foot"
11+
12+
printf '%b\n' '<openbox_pipe_menu>
13+
<item label="Web Browser">
14+
<action name="Execute"><command>firefox</command></action>
15+
</item>
16+
<item label="Terminal">
17+
<action name="Execute" command="'"$terminal"'"/>
18+
</item>
19+
<item label="Tweaks">
20+
<action name="Execute" command="labwc-tweaks"/>
21+
</item>
22+
<separator />'
23+
24+
labwc-menu-generator -b -t "${terminal}"
25+
26+
printf '%b\n' '<separator />
27+
<item label="Reconfigure">
28+
<action name="Reconfigure" />
29+
</item>
30+
<item label="Exit">
31+
<action name="Exit" />
32+
</item>
33+
</openbox_pipe_menu>'

0 commit comments

Comments
 (0)