feat(bar): add applications widget

This pull request introduces a new Applications widget that displays a
user-defined list of application launchers in the UI. Each app entry
supports an icon, a label, and executes its configured command on click.

The design of this widget is inspired by the Applications Widget of YASB
Reborn. I personally missed this functionality and aimed to bring a
similar experience to komorebi-bar.

Further information is in the text of PR #1415
This commit is contained in:
Alisher Galiev
2025-04-21 09:17:25 +05:00
committed by LGUG2Z
parent 6e7d8fb922
commit 10424b696f
5 changed files with 688 additions and 1 deletions

View File

@@ -14,6 +14,122 @@
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"required": [
"Applications"
],
"properties": {
"Applications": {
"type": "object",
"required": [
"enable",
"items"
],
"properties": {
"display": {
"description": "Default display format for all applications (optional). Could be overridden per application. Defaults to `Icon`.",
"oneOf": [
{
"description": "Show only the application icon.",
"type": "string",
"enum": [
"Icon"
]
},
{
"description": "Show only the application name as text.",
"type": "string",
"enum": [
"Text"
]
},
{
"description": "Show both the application icon and name.",
"type": "string",
"enum": [
"IconAndText"
]
}
]
},
"enable": {
"description": "Enables or disables the applications widget.",
"type": "boolean"
},
"items": {
"description": "List of configured applications to display.",
"type": "array",
"items": {
"type": "object",
"required": [
"command",
"name"
],
"properties": {
"command": {
"description": "Command to execute (e.g. path to the application or shell command).",
"type": "string"
},
"display": {
"description": "Display format for this application button (optional). Overrides global format if set.",
"oneOf": [
{
"description": "Show only the application icon.",
"type": "string",
"enum": [
"Icon"
]
},
{
"description": "Show only the application name as text.",
"type": "string",
"enum": [
"Text"
]
},
{
"description": "Show both the application icon and name.",
"type": "string",
"enum": [
"IconAndText"
]
}
]
},
"enable": {
"description": "Whether to enable this application button (optional). Inherits from the global `Applications` setting if omitted.",
"type": "boolean"
},
"icon": {
"description": "Optional icon: a path to an image or a text-based glyph (e.g., from Nerd Fonts). If not set, and if the `command` is a path to an executable, an icon might be extracted from it. Note: glyphs require a compatible `font_family`.",
"type": "string"
},
"name": {
"description": "Display name of the application.",
"type": "string"
},
"show_command_on_hover": {
"description": "Whether to show the launch command on hover (optional). Inherits from the global `Applications` setting if omitted.",
"type": "boolean"
}
}
}
},
"show_command_on_hover": {
"description": "Whether to show the launch command on hover (optional). Could be overridden per application. Defaults to `false` if not set.",
"type": "boolean"
},
"spacing": {
"description": "Horizontal spacing between application buttons.",
"type": "number",
"format": "float"
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
@@ -1541,6 +1657,122 @@
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"required": [
"Applications"
],
"properties": {
"Applications": {
"type": "object",
"required": [
"enable",
"items"
],
"properties": {
"display": {
"description": "Default display format for all applications (optional). Could be overridden per application. Defaults to `Icon`.",
"oneOf": [
{
"description": "Show only the application icon.",
"type": "string",
"enum": [
"Icon"
]
},
{
"description": "Show only the application name as text.",
"type": "string",
"enum": [
"Text"
]
},
{
"description": "Show both the application icon and name.",
"type": "string",
"enum": [
"IconAndText"
]
}
]
},
"enable": {
"description": "Enables or disables the applications widget.",
"type": "boolean"
},
"items": {
"description": "List of configured applications to display.",
"type": "array",
"items": {
"type": "object",
"required": [
"command",
"name"
],
"properties": {
"command": {
"description": "Command to execute (e.g. path to the application or shell command).",
"type": "string"
},
"display": {
"description": "Display format for this application button (optional). Overrides global format if set.",
"oneOf": [
{
"description": "Show only the application icon.",
"type": "string",
"enum": [
"Icon"
]
},
{
"description": "Show only the application name as text.",
"type": "string",
"enum": [
"Text"
]
},
{
"description": "Show both the application icon and name.",
"type": "string",
"enum": [
"IconAndText"
]
}
]
},
"enable": {
"description": "Whether to enable this application button (optional). Inherits from the global `Applications` setting if omitted.",
"type": "boolean"
},
"icon": {
"description": "Optional icon: a path to an image or a text-based glyph (e.g., from Nerd Fonts). If not set, and if the `command` is a path to an executable, an icon might be extracted from it. Note: glyphs require a compatible `font_family`.",
"type": "string"
},
"name": {
"description": "Display name of the application.",
"type": "string"
},
"show_command_on_hover": {
"description": "Whether to show the launch command on hover (optional). Inherits from the global `Applications` setting if omitted.",
"type": "boolean"
}
}
}
},
"show_command_on_hover": {
"description": "Whether to show the launch command on hover (optional). Could be overridden per application. Defaults to `false` if not set.",
"type": "boolean"
},
"spacing": {
"description": "Horizontal spacing between application buttons.",
"type": "number",
"format": "float"
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
@@ -3001,6 +3233,122 @@
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"required": [
"Applications"
],
"properties": {
"Applications": {
"type": "object",
"required": [
"enable",
"items"
],
"properties": {
"display": {
"description": "Default display format for all applications (optional). Could be overridden per application. Defaults to `Icon`.",
"oneOf": [
{
"description": "Show only the application icon.",
"type": "string",
"enum": [
"Icon"
]
},
{
"description": "Show only the application name as text.",
"type": "string",
"enum": [
"Text"
]
},
{
"description": "Show both the application icon and name.",
"type": "string",
"enum": [
"IconAndText"
]
}
]
},
"enable": {
"description": "Enables or disables the applications widget.",
"type": "boolean"
},
"items": {
"description": "List of configured applications to display.",
"type": "array",
"items": {
"type": "object",
"required": [
"command",
"name"
],
"properties": {
"command": {
"description": "Command to execute (e.g. path to the application or shell command).",
"type": "string"
},
"display": {
"description": "Display format for this application button (optional). Overrides global format if set.",
"oneOf": [
{
"description": "Show only the application icon.",
"type": "string",
"enum": [
"Icon"
]
},
{
"description": "Show only the application name as text.",
"type": "string",
"enum": [
"Text"
]
},
{
"description": "Show both the application icon and name.",
"type": "string",
"enum": [
"IconAndText"
]
}
]
},
"enable": {
"description": "Whether to enable this application button (optional). Inherits from the global `Applications` setting if omitted.",
"type": "boolean"
},
"icon": {
"description": "Optional icon: a path to an image or a text-based glyph (e.g., from Nerd Fonts). If not set, and if the `command` is a path to an executable, an icon might be extracted from it. Note: glyphs require a compatible `font_family`.",
"type": "string"
},
"name": {
"description": "Display name of the application.",
"type": "string"
},
"show_command_on_hover": {
"description": "Whether to show the launch command on hover (optional). Inherits from the global `Applications` setting if omitted.",
"type": "boolean"
}
}
}
},
"show_command_on_hover": {
"description": "Whether to show the launch command on hover (optional). Could be overridden per application. Defaults to `false` if not set.",
"type": "boolean"
},
"spacing": {
"description": "Horizontal spacing between application buttons.",
"type": "number",
"format": "float"
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [