[experiment] support menu.yaml

This commit is contained in:
tokyo4j 2024-08-23 15:27:08 +09:00
parent 85b6e25484
commit 52a1c1c880
4 changed files with 119 additions and 33 deletions

View file

@ -106,13 +106,23 @@ ID attributes are unique. Duplicates are ignored.
When writing pipe menu scripts, make sure to escape XML special characters such
as "&" ("&amp;"), "<" ("&lt;"), and ">" ("&gt;").
# LOCALISATION
Available localisation for the default "client-menu" is only shown if no
"client-menu" is present in menu.xml. Any menu definition in menu.xml is
interpreted as a user-override.
# YAML SUPPORT
Like rc.yaml, labwc supports menu.yaml instead of menu.xml. See labwc-config(5)
for its syntax. Note that following keys in singular form can be expressed as
plural form in menu.yaml:
- *menus* (converted to *menu*)
- *items* (converted to *item*)
See /usr/share/docs/labwc/menu.yaml for an example menu configuration in YAML.
# SEE ALSO
labwc(1), labwc-actions(5), labwc-config(5), labwc-theme(5)

33
docs/menu.yaml Normal file
View file

@ -0,0 +1,33 @@
menu:
- id: client-menu
item:
label: Minimize
action: { name: Iconify }
item:
label: Maximize
action: { name: ToggleMaximize }
menu:
id: workspaces
label: Workspace
item:
label: Move Left
action: { name: SendToDesktop, to: left }
item:
label: Move Right
action: { name: SendToDesktop, to: right }
separator:
item:
label: Always on Visible Workspace
action: { name: ToggleOmnipresent }
item:
label: Close
action: { name: Close }
- id: root-menu
items:
- label: Terminal
action: { name: Execute, command: alacritty }
- label: Reconfigure
action: { name: Reconfigure }
- label: Exit
action: { name: Exit }