mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-16 22:31:03 +02:00
feat: add menu
module
Adds a new Menu module which allows users to create XDG or custom menus that open after clicking on a button. Resolves #534 Co-authored-by: Jake Stanger <mail@jstanger.dev>
This commit is contained in:
parent
e99a04923d
commit
96e10fe139
14 changed files with 1419 additions and 6 deletions
102
examples/menu/default.corn
Normal file
102
examples/menu/default.corn
Normal file
|
@ -0,0 +1,102 @@
|
|||
let {
|
||||
$menu = [
|
||||
{
|
||||
type = "xdg_entry"
|
||||
label = "Accessories"
|
||||
icon = "accessories"
|
||||
categories = [
|
||||
"Accessibility"
|
||||
"Core"
|
||||
"Legacy"
|
||||
"Utility"
|
||||
]
|
||||
}
|
||||
{
|
||||
type = "xdg_entry"
|
||||
label = "Development"
|
||||
icon = "applications-development"
|
||||
categories = [
|
||||
"Development"
|
||||
]
|
||||
}
|
||||
{
|
||||
type = "xdg_entry"
|
||||
label = "Education"
|
||||
icon = "applications-education"
|
||||
categories = [
|
||||
"Education"
|
||||
]
|
||||
}
|
||||
{
|
||||
type = "xdg_entry"
|
||||
label = "Games"
|
||||
icon = "applications-games"
|
||||
categories = [
|
||||
"Games"
|
||||
]
|
||||
}
|
||||
{
|
||||
type = "xdg_entry"
|
||||
label = "Graphics"
|
||||
icon = "applications-graphics"
|
||||
categories = [
|
||||
"Graphics"
|
||||
]
|
||||
}
|
||||
{
|
||||
type = "xdg_entry"
|
||||
label = "Multimedia"
|
||||
icon = "applications-multimedia"
|
||||
categories = [
|
||||
"Audio"
|
||||
"Video"
|
||||
"AudioVideo"
|
||||
]
|
||||
}
|
||||
{
|
||||
type = "xdg_entry"
|
||||
label = "Network"
|
||||
icon = "applications-internet"
|
||||
categories = [
|
||||
"Network"
|
||||
]
|
||||
}
|
||||
{
|
||||
type = "xdg_entry"
|
||||
label = "Office"
|
||||
icon = "applications-office"
|
||||
categories = [
|
||||
"Office"
|
||||
]
|
||||
}
|
||||
{
|
||||
type = "xdg_entry"
|
||||
label = "Science"
|
||||
icon = "applications-science"
|
||||
categories = [
|
||||
"Science"
|
||||
]
|
||||
}
|
||||
{
|
||||
type = "xdg_entry"
|
||||
label = "System"
|
||||
icon = "applications-system"
|
||||
categories = [
|
||||
"Emulator"
|
||||
"System"
|
||||
]
|
||||
}
|
||||
{ type = "xdg_other" }
|
||||
{
|
||||
type = "xdg_entry"
|
||||
label = "Settings"
|
||||
icon = "preferences-system"
|
||||
categories = [
|
||||
"Settings"
|
||||
"Screensaver"
|
||||
]
|
||||
}
|
||||
]
|
||||
} in {
|
||||
start = [ { type = "menu" center = $menu } ]
|
||||
}
|
107
examples/menu/default.json
Normal file
107
examples/menu/default.json
Normal file
|
@ -0,0 +1,107 @@
|
|||
{
|
||||
"start": [
|
||||
{
|
||||
"type": "menu",
|
||||
"center": [
|
||||
{
|
||||
"type": "xdg_entry",
|
||||
"label": "Accessories",
|
||||
"icon": "accessories",
|
||||
"categories": [
|
||||
"Accessibility",
|
||||
"Core",
|
||||
"Legacy",
|
||||
"Utility"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "xdg_entry",
|
||||
"label": "Development",
|
||||
"icon": "applications-development",
|
||||
"categories": [
|
||||
"Development"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "xdg_entry",
|
||||
"label": "Education",
|
||||
"icon": "applications-education",
|
||||
"categories": [
|
||||
"Education"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "xdg_entry",
|
||||
"label": "Games",
|
||||
"icon": "applications-games",
|
||||
"categories": [
|
||||
"Games"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "xdg_entry",
|
||||
"label": "Graphics",
|
||||
"icon": "applications-graphics",
|
||||
"categories": [
|
||||
"Graphics"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "xdg_entry",
|
||||
"label": "Multimedia",
|
||||
"icon": "applications-multimedia",
|
||||
"categories": [
|
||||
"Audio",
|
||||
"Video",
|
||||
"AudioVideo"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "xdg_entry",
|
||||
"label": "Network",
|
||||
"icon": "applications-internet",
|
||||
"categories": [
|
||||
"Network"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "xdg_entry",
|
||||
"label": "Office",
|
||||
"icon": "applications-office",
|
||||
"categories": [
|
||||
"Office"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "xdg_entry",
|
||||
"label": "Science",
|
||||
"icon": "applications-science",
|
||||
"categories": [
|
||||
"Science"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "xdg_entry",
|
||||
"label": "System",
|
||||
"icon": "applications-system",
|
||||
"categories": [
|
||||
"Emulator",
|
||||
"System"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "xdg_other"
|
||||
},
|
||||
{
|
||||
"type": "xdg_entry",
|
||||
"label": "Settings",
|
||||
"icon": "preferences-system",
|
||||
"categories": [
|
||||
"Settings",
|
||||
"Screensaver"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
87
examples/menu/default.toml
Normal file
87
examples/menu/default.toml
Normal file
|
@ -0,0 +1,87 @@
|
|||
[[start]]
|
||||
type = "menu"
|
||||
|
||||
[[start.center]]
|
||||
type = "xdg_entry"
|
||||
label = "Accessories"
|
||||
icon = "accessories"
|
||||
categories = [
|
||||
"Accessibility",
|
||||
"Core",
|
||||
"Legacy",
|
||||
"Utility",
|
||||
]
|
||||
|
||||
[[start.center]]
|
||||
type = "xdg_entry"
|
||||
label = "Development"
|
||||
icon = "applications-development"
|
||||
categories = ["Development"]
|
||||
|
||||
[[start.center]]
|
||||
type = "xdg_entry"
|
||||
label = "Education"
|
||||
icon = "applications-education"
|
||||
categories = ["Education"]
|
||||
|
||||
[[start.center]]
|
||||
type = "xdg_entry"
|
||||
label = "Games"
|
||||
icon = "applications-games"
|
||||
categories = ["Games"]
|
||||
|
||||
[[start.center]]
|
||||
type = "xdg_entry"
|
||||
label = "Graphics"
|
||||
icon = "applications-graphics"
|
||||
categories = ["Graphics"]
|
||||
|
||||
[[start.center]]
|
||||
type = "xdg_entry"
|
||||
label = "Multimedia"
|
||||
icon = "applications-multimedia"
|
||||
categories = [
|
||||
"Audio",
|
||||
"Video",
|
||||
"AudioVideo",
|
||||
]
|
||||
|
||||
[[start.center]]
|
||||
type = "xdg_entry"
|
||||
label = "Network"
|
||||
icon = "applications-internet"
|
||||
categories = ["Network"]
|
||||
|
||||
[[start.center]]
|
||||
type = "xdg_entry"
|
||||
label = "Office"
|
||||
icon = "applications-office"
|
||||
categories = ["Office"]
|
||||
|
||||
[[start.center]]
|
||||
type = "xdg_entry"
|
||||
label = "Science"
|
||||
icon = "applications-science"
|
||||
categories = ["Science"]
|
||||
|
||||
[[start.center]]
|
||||
type = "xdg_entry"
|
||||
label = "System"
|
||||
icon = "applications-system"
|
||||
categories = [
|
||||
"Emulator",
|
||||
"System",
|
||||
]
|
||||
|
||||
[[start.center]]
|
||||
type = "xdg_other"
|
||||
|
||||
[[start.center]]
|
||||
type = "xdg_entry"
|
||||
label = "Settings"
|
||||
icon = "preferences-system"
|
||||
categories = [
|
||||
"Settings",
|
||||
"Screensaver",
|
||||
]
|
||||
|
68
examples/menu/default.yml
Normal file
68
examples/menu/default.yml
Normal file
|
@ -0,0 +1,68 @@
|
|||
start:
|
||||
- type: menu
|
||||
center:
|
||||
- type: xdg_entry
|
||||
label: Accessories
|
||||
icon: accessories
|
||||
categories:
|
||||
- Accessibility
|
||||
- Core
|
||||
- Legacy
|
||||
- Utility
|
||||
- type: xdg_entry
|
||||
label: Development
|
||||
icon: applications-development
|
||||
categories:
|
||||
- Development
|
||||
- type: xdg_entry
|
||||
label: Education
|
||||
icon: applications-education
|
||||
categories:
|
||||
- Education
|
||||
- type: xdg_entry
|
||||
label: Games
|
||||
icon: applications-games
|
||||
categories:
|
||||
- Games
|
||||
- type: xdg_entry
|
||||
label: Graphics
|
||||
icon: applications-graphics
|
||||
categories:
|
||||
- Graphics
|
||||
- type: xdg_entry
|
||||
label: Multimedia
|
||||
icon: applications-multimedia
|
||||
categories:
|
||||
- Audio
|
||||
- Video
|
||||
- AudioVideo
|
||||
- type: xdg_entry
|
||||
label: Network
|
||||
icon: applications-internet
|
||||
categories:
|
||||
- Network
|
||||
- type: xdg_entry
|
||||
label: Office
|
||||
icon: applications-office
|
||||
categories:
|
||||
- Office
|
||||
- type: xdg_entry
|
||||
label: Science
|
||||
icon: applications-science
|
||||
categories:
|
||||
- Science
|
||||
- type: xdg_entry
|
||||
label: System
|
||||
icon: applications-system
|
||||
categories:
|
||||
- Emulator
|
||||
- System
|
||||
- type: xdg_other
|
||||
- type: xdg_entry
|
||||
label: Settings
|
||||
icon: preferences-system
|
||||
categories:
|
||||
- Settings
|
||||
- Screensaver
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue