diff --git a/.gitignore b/.gitignore index afe4db65..7a2a220f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ /.idea /.direnv /komorebic/applications.json +/komorebi-schema +/bar-schema diff --git a/Cargo.lock b/Cargo.lock index ba4111fa..36227a49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3045,7 +3045,7 @@ dependencies = [ [[package]] name = "komorebi-bar" -version = "0.1.39" +version = "0.1.0" dependencies = [ "chrono", "chrono-tz", diff --git a/justfile b/justfile index ab316fef..41279c84 100644 --- a/justfile +++ b/justfile @@ -51,6 +51,19 @@ docgen: jsonschema: cargo run --package komorebic -- static-config-schema > schema.json cargo run --package komorebic -- application-specific-configuration-schema > schema.asc.json + cargo run --package komorebi-bar -- --schema > schema.bar.json + +version := `cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.name == "komorebi") | .version'` + +schemagen: + mkdir -p komorebi-schema + schemars-docgen schema.json -o komorebi-schema/komorebi.html + schemars-docgen schema.bar.json -o komorebi-schema/bar.html + cp schema.json komorebi-schema/komorebi.{{ version }}.schema.json + cp schema.bar.json komorebi-schema/komorebi.bar.{{ version }}.schema.json + +schemapub: + wrangler pages deploy --project-name komorebi-for-mac --branch main ./komorebi-schema depgen: cargo deny check diff --git a/komorebi-bar/Cargo.toml b/komorebi-bar/Cargo.toml index 251d6ce9..fb6bc50f 100644 --- a/komorebi-bar/Cargo.toml +++ b/komorebi-bar/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "komorebi-bar" -version = "0.1.39" +version = "0.1.0" edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/komorebi-bar/src/config.rs b/komorebi-bar/src/config.rs index 33ae0103..1bf84591 100644 --- a/komorebi-bar/src/config.rs +++ b/komorebi-bar/src/config.rs @@ -15,7 +15,9 @@ use std::path::PathBuf; #[derive(Clone, Debug, Serialize, Deserialize)] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -/// The `komorebi.bar.json` configuration file reference for `v0.1.39` +/// The `komorebi.bar.json` static configuration file reference for komorebi for Mac `v0.1.0` +/// +/// `"$schema": "https://komorebi-for-mac.lgug2z.com/komorebi.bar.0.1.0.schema.json"` pub struct KomobarConfig { /// Bar height (default: 50) pub height: Option, diff --git a/komorebi/src/static_config.rs b/komorebi/src/static_config.rs index 569d8ddc..2543534d 100644 --- a/komorebi/src/static_config.rs +++ b/komorebi/src/static_config.rs @@ -365,7 +365,9 @@ pub enum AppSpecificConfigurationPath { #[serde_with::serde_as] #[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq)] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -/// The `komorebi.json` static configuration file reference for `v0.1.39` +/// The `komorebi.json` static configuration file reference for komorebi for Mac `v0.1.0` +/// +/// `"$schema": "https://komorebi-for-mac.lgug2z.com/komorebi.0.1.0.schema.json"` pub struct StaticConfig { // /// DISCOURAGED: Minimum width for a window to be eligible for tiling // #[serde(skip_serializing_if = "Option::is_none")] diff --git a/schema.bar.json b/schema.bar.json new file mode 100644 index 00000000..f702adbe --- /dev/null +++ b/schema.bar.json @@ -0,0 +1,2257 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "KomobarConfig", + "description": "The `komorebi.bar.json` static configuration file reference for komorebi for Mac `v0.1.0`\n\n`\"$schema\": \"https://komorebi-for-mac.lgug2z.com/komorebi.bar.0.1.0.schema.json\"`", + "type": "object", + "properties": { + "center_widgets": { + "description": "Center widgets (ordered left-to-right)", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/WidgetConfig" + } + }, + "font_family": { + "description": "Font family", + "type": [ + "string", + "null" + ] + }, + "font_size": { + "description": "Font size (default: 12.5)", + "type": [ + "number", + "null" + ], + "format": "float" + }, + "frame": { + "description": "Frame options (see: https://docs.rs/egui/latest/egui/containers/frame/struct.Frame.html)", + "anyOf": [ + { + "$ref": "#/$defs/FrameConfig" + }, + { + "type": "null" + } + ] + }, + "grouping": { + "description": "Visual grouping for widgets", + "anyOf": [ + { + "$ref": "#/$defs/Grouping" + }, + { + "type": "null" + } + ] + }, + "height": { + "description": "Bar height (default: 50)", + "type": [ + "number", + "null" + ], + "format": "float" + }, + "icon_scale": { + "description": "Scale of the icons relative to the font_size [[1.0-2.0]]. (default: 1.4)", + "type": [ + "number", + "null" + ], + "format": "float" + }, + "left_widgets": { + "description": "Options for mouse interaction on the bar\nLeft side widgets (ordered left-to-right)", + "type": "array", + "items": { + "$ref": "#/$defs/WidgetConfig" + } + }, + "margin": { + "description": "Bar margin. Use one value for all sides or use a grouped margin for horizontal and/or\nvertical definition which can each take a single value for a symmetric margin or two\nvalues for each side, i.e.:\n```json\n\"margin\": {\n \"horizontal\": 10\n}\n```\nor:\n```json\n\"margin\": {\n \"vertical\": [top, bottom]\n}\n```\nYou can also set individual margin on each side like this:\n```json\n\"margin\": {\n \"top\": 10,\n \"bottom\": 10,\n \"left\": 10,\n \"right\": 10,\n}\n```\nBy default, margin is set to 0 on all sides.", + "anyOf": [ + { + "$ref": "#/$defs/SpacingKind" + }, + { + "type": "null" + } + ] + }, + "max_label_width": { + "description": "Max label width before text truncation (default: 400.0)", + "type": [ + "number", + "null" + ], + "format": "float" + }, + "monitor": { + "description": "The monitor index or the full monitor options", + "$ref": "#/$defs/MonitorConfigOrIndex" + }, + "padding": { + "description": "Bar padding. Use one value for all sides or use a grouped padding for horizontal and/or\nvertical definition which can each take a single value for a symmetric padding or two\nvalues for each side, i.e.:\n```json\n\"padding\": {\n \"horizontal\": 10\n}\n```\nor:\n```json\n\"padding\": {\n \"horizontal\": [left, right]\n}\n```\nYou can also set individual padding on each side like this:\n```json\n\"padding\": {\n \"top\": 10,\n \"bottom\": 10,\n \"left\": 10,\n \"right\": 10,\n}\n```\nBy default, padding is set to 10 on all sides.", + "anyOf": [ + { + "$ref": "#/$defs/SpacingKind" + }, + { + "type": "null" + } + ] + }, + "position": { + "description": "Bar positioning options", + "anyOf": [ + { + "$ref": "#/$defs/PositionConfig" + }, + { + "type": "null" + } + ] + }, + "right_widgets": { + "description": "Right side widgets (ordered left-to-right)", + "type": "array", + "items": { + "$ref": "#/$defs/WidgetConfig" + } + }, + "theme": { + "description": "Theme", + "anyOf": [ + { + "$ref": "#/$defs/KomobarTheme" + }, + { + "type": "null" + } + ] + }, + "transparency_alpha": { + "description": "Alpha value for the color transparency [[0-255]] (default: 200)", + "type": [ + "integer", + "null" + ], + "format": "uint8", + "maximum": 255, + "minimum": 0 + }, + "widget_spacing": { + "description": "Spacing between widgets (default: 10.0)", + "type": [ + "number", + "null" + ], + "format": "float" + } + }, + "required": [ + "monitor", + "left_widgets", + "right_widgets" + ], + "$defs": { + "AppConfig": { + "type": "object", + "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.", + "anyOf": [ + { + "$ref": "#/$defs/DisplayFormat" + }, + { + "type": "null" + } + ] + }, + "enable": { + "description": "Whether to enable this application button (optional).\nInherits from the global `Applications` setting if omitted.", + "type": [ + "boolean", + "null" + ] + }, + "icon": { + "description": "Optional icon: a path to an image or a text-based glyph (e.g., from Nerd Fonts).\nIf not set, and if the `command` is a path to an executable, an icon might be extracted from it.\nNote: glyphs require a compatible `font_family`.", + "type": [ + "string", + "null" + ] + }, + "name": { + "description": "Display name of the application.", + "type": "string" + }, + "show_command_on_hover": { + "description": "Whether to show the launch command on hover (optional).\nInherits from the global `Applications` setting if omitted.", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "name", + "command" + ] + }, + "ApplicationsConfig": { + "type": "object", + "properties": { + "display": { + "description": "Default display format for all applications (optional).\nCould be overridden per application. Defaults to `Icon`.", + "anyOf": [ + { + "$ref": "#/$defs/DisplayFormat" + }, + { + "type": "null" + } + ] + }, + "enable": { + "description": "Enables or disables the applications widget.", + "type": "boolean" + }, + "items": { + "description": "List of configured applications to display.", + "type": "array", + "items": { + "$ref": "#/$defs/AppConfig" + } + }, + "show_command_on_hover": { + "description": "Whether to show the launch command on hover (optional).\nCould be overridden per application. Defaults to `false` if not set.", + "type": [ + "boolean", + "null" + ] + }, + "spacing": { + "description": "Horizontal spacing between application buttons.", + "type": [ + "number", + "null" + ], + "format": "float" + } + }, + "required": [ + "enable", + "items" + ] + }, + "Base16": { + "type": "string", + "enum": [ + "3024", + "Apathy", + "Apprentice", + "Ashes", + "AtelierCaveLight", + "AtelierCave", + "AtelierDuneLight", + "AtelierDune", + "AtelierEstuaryLight", + "AtelierEstuary", + "AtelierForestLight", + "AtelierForest", + "AtelierHeathLight", + "AtelierHeath", + "AtelierLakesideLight", + "AtelierLakeside", + "AtelierPlateauLight", + "AtelierPlateau", + "AtelierSavannaLight", + "AtelierSavanna", + "AtelierSeasideLight", + "AtelierSeaside", + "AtelierSulphurpoolLight", + "AtelierSulphurpool", + "Atlas", + "AyuDark", + "AyuLight", + "AyuMirage", + "Aztec", + "Bespin", + "BlackMetalBathory", + "BlackMetalBurzum", + "BlackMetalDarkFuneral", + "BlackMetalGorgoroth", + "BlackMetalImmortal", + "BlackMetalKhold", + "BlackMetalMarduk", + "BlackMetalMayhem", + "BlackMetalNile", + "BlackMetalVenom", + "BlackMetal", + "Blueforest", + "Blueish", + "Brewer", + "Bright", + "Brogrammer", + "BrushtreesDark", + "Brushtrees", + "Caroline", + "CatppuccinFrappe", + "CatppuccinLatte", + "CatppuccinMacchiato", + "CatppuccinMocha", + "Chalk", + "Circus", + "ClassicDark", + "ClassicLight", + "Codeschool", + "Colors", + "Cupcake", + "Cupertino", + "DaOneBlack", + "DaOneGray", + "DaOneOcean", + "DaOnePaper", + "DaOneSea", + "DaOneWhite", + "DanqingLight", + "Danqing", + "Darcula", + "Darkmoss", + "Darktooth", + "Darkviolet", + "Decaf", + "DefaultDark", + "DefaultLight", + "Dirtysea", + "Dracula", + "EdgeDark", + "EdgeLight", + "Eighties", + "EmbersLight", + "Embers", + "Emil", + "EquilibriumDark", + "EquilibriumGrayDark", + "EquilibriumGrayLight", + "EquilibriumLight", + "Eris", + "Espresso", + "EvaDim", + "Eva", + "EvenokDark", + "EverforestDarkHard", + "Everforest", + "Flat", + "Framer", + "FruitSoda", + "Gigavolt", + "Github", + "GoogleDark", + "GoogleLight", + "Gotham", + "GrayscaleDark", + "GrayscaleLight", + "Greenscreen", + "Gruber", + "GruvboxDarkHard", + "GruvboxDarkMedium", + "GruvboxDarkPale", + "GruvboxDarkSoft", + "GruvboxLightHard", + "GruvboxLightMedium", + "GruvboxLightSoft", + "GruvboxMaterialDarkHard", + "GruvboxMaterialDarkMedium", + "GruvboxMaterialDarkSoft", + "GruvboxMaterialLightHard", + "GruvboxMaterialLightMedium", + "GruvboxMaterialLightSoft", + "Hardcore", + "Harmonic16Dark", + "Harmonic16Light", + "HeetchLight", + "Heetch", + "Helios", + "Hopscotch", + "HorizonDark", + "HorizonLight", + "HorizonTerminalDark", + "HorizonTerminalLight", + "HumanoidDark", + "HumanoidLight", + "IaDark", + "IaLight", + "Icy", + "Irblack", + "Isotope", + "Jabuti", + "Kanagawa", + "Katy", + "Kimber", + "Lime", + "Macintosh", + "Marrakesh", + "Materia", + "MaterialDarker", + "MaterialLighter", + "MaterialPalenight", + "MaterialVivid", + "Material", + "MeasuredDark", + "MeasuredLight", + "MellowPurple", + "MexicoLight", + "Mocha", + "Monokai", + "Moonlight", + "Mountain", + "Nebula", + "NordLight", + "Nord", + "Nova", + "Ocean", + "Oceanicnext", + "OneLight", + "OnedarkDark", + "Onedark", + "OutrunDark", + "OxocarbonDark", + "OxocarbonLight", + "Pandora", + "PapercolorDark", + "PapercolorLight", + "Paraiso", + "Pasque", + "Phd", + "Pico", + "Pinky", + "Pop", + "Porple", + "PreciousDarkEleven", + "PreciousDarkFifteen", + "PreciousLightWarm", + "PreciousLightWhite", + "PrimerDarkDimmed", + "PrimerDark", + "PrimerLight", + "Purpledream", + "Qualia", + "Railscasts", + "Rebecca", + "RosePineDawn", + "RosePineMoon", + "RosePine", + "Saga", + "Sagelight", + "Sakura", + "Sandcastle", + "SelenizedBlack", + "SelenizedDark", + "SelenizedLight", + "SelenizedWhite", + "Seti", + "ShadesOfPurple", + "ShadesmearDark", + "ShadesmearLight", + "Shapeshifter", + "SilkDark", + "SilkLight", + "Snazzy", + "SolarflareLight", + "Solarflare", + "SolarizedDark", + "SolarizedLight", + "Spaceduck", + "Spacemacs", + "Sparky", + "StandardizedDark", + "StandardizedLight", + "Stella", + "StillAlive", + "Summercamp", + "SummerfruitDark", + "SummerfruitLight", + "SynthMidnightDark", + "SynthMidnightLight", + "Tango", + "Tarot", + "Tender", + "TerracottaDark", + "Terracotta", + "TokyoCityDark", + "TokyoCityLight", + "TokyoCityTerminalDark", + "TokyoCityTerminalLight", + "TokyoNightDark", + "TokyoNightLight", + "TokyoNightMoon", + "TokyoNightStorm", + "TokyoNightTerminalDark", + "TokyoNightTerminalLight", + "TokyoNightTerminalStorm", + "TokyodarkTerminal", + "Tokyodark", + "TomorrowNightEighties", + "TomorrowNight", + "Tomorrow", + "Tube", + "Twilight", + "UnikittyDark", + "UnikittyLight", + "UnikittyReversible", + "Uwunicorn", + "Vesper", + "Vice", + "Vulcan", + "Windows10Light", + "Windows10", + "Windows95Light", + "Windows95", + "WindowsHighcontrastLight", + "WindowsHighcontrast", + "WindowsNtLight", + "WindowsNt", + "Woodland", + "XcodeDusk", + "Zenbones", + "Zenburn" + ] + }, + "Base16ColourPalette": { + "type": "object", + "properties": { + "base_00": { + "$ref": "#/$defs/Colour" + }, + "base_01": { + "$ref": "#/$defs/Colour" + }, + "base_02": { + "$ref": "#/$defs/Colour" + }, + "base_03": { + "$ref": "#/$defs/Colour" + }, + "base_04": { + "$ref": "#/$defs/Colour" + }, + "base_05": { + "$ref": "#/$defs/Colour" + }, + "base_06": { + "$ref": "#/$defs/Colour" + }, + "base_07": { + "$ref": "#/$defs/Colour" + }, + "base_08": { + "$ref": "#/$defs/Colour" + }, + "base_09": { + "$ref": "#/$defs/Colour" + }, + "base_0a": { + "$ref": "#/$defs/Colour" + }, + "base_0b": { + "$ref": "#/$defs/Colour" + }, + "base_0c": { + "$ref": "#/$defs/Colour" + }, + "base_0d": { + "$ref": "#/$defs/Colour" + }, + "base_0e": { + "$ref": "#/$defs/Colour" + }, + "base_0f": { + "$ref": "#/$defs/Colour" + } + }, + "required": [ + "base_00", + "base_01", + "base_02", + "base_03", + "base_04", + "base_05", + "base_06", + "base_07", + "base_08", + "base_09", + "base_0a", + "base_0b", + "base_0c", + "base_0d", + "base_0e", + "base_0f" + ] + }, + "Base16Value": { + "type": "string", + "enum": [ + "Base00", + "Base01", + "Base02", + "Base03", + "Base04", + "Base05", + "Base06", + "Base07", + "Base08", + "Base09", + "Base0A", + "Base0B", + "Base0C", + "Base0D", + "Base0E", + "Base0F" + ] + }, + "BatteryConfig": { + "type": "object", + "properties": { + "auto_select_under": { + "description": "Select when the current percentage is under this value [[1-100]]", + "type": [ + "integer", + "null" + ], + "format": "uint8", + "maximum": 255, + "minimum": 0 + }, + "data_refresh_interval": { + "description": "Data refresh interval (default: 10 seconds)", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0 + }, + "enable": { + "description": "Enable the Battery widget", + "type": "boolean" + }, + "hide_on_full_charge": { + "description": "Hide the widget if the battery is at full charge", + "type": [ + "boolean", + "null" + ] + }, + "label_prefix": { + "description": "Display label prefix", + "anyOf": [ + { + "$ref": "#/$defs/LabelPrefix" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "enable" + ] + }, + "Catppuccin": { + "type": "string", + "enum": [ + "Frappe", + "Latte", + "Macchiato", + "Mocha" + ] + }, + "CatppuccinValue": { + "type": "string", + "enum": [ + "Rosewater", + "Flamingo", + "Pink", + "Mauve", + "Red", + "Maroon", + "Peach", + "Yellow", + "Green", + "Teal", + "Sky", + "Sapphire", + "Blue", + "Lavender", + "Text", + "Subtext1", + "Subtext0", + "Overlay2", + "Overlay1", + "Overlay0", + "Surface2", + "Surface1", + "Surface0", + "Base", + "Mantle", + "Crust" + ] + }, + "Colour": { + "anyOf": [ + { + "description": "Colour represented as RGB", + "$ref": "#/$defs/Rgb" + }, + { + "description": "Colour represented as Hex", + "$ref": "#/$defs/Hex" + } + ] + }, + "CpuConfig": { + "type": "object", + "properties": { + "auto_select_over": { + "description": "Select when the current percentage is over this value [[1-100]]", + "type": [ + "integer", + "null" + ], + "format": "uint8", + "maximum": 255, + "minimum": 0 + }, + "data_refresh_interval": { + "description": "Data refresh interval (default: 10 seconds)", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0 + }, + "enable": { + "description": "Enable the Cpu widget", + "type": "boolean" + }, + "label_prefix": { + "description": "Display label prefix", + "anyOf": [ + { + "$ref": "#/$defs/LabelPrefix" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "enable" + ] + }, + "CustomModifiers": { + "description": "Custom format with additive modifiers for integer format specifiers", + "type": "object", + "properties": { + "format": { + "description": "Custom format (https://docs.rs/chrono/latest/chrono/format/strftime/index.html)", + "type": "string" + }, + "modifiers": { + "description": "Additive modifiers for integer format specifiers (e.g. { \"%U\": 1 } to increment the zero-indexed week number by 1)", + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "int32" + } + } + }, + "required": [ + "format", + "modifiers" + ] + }, + "DateConfig": { + "type": "object", + "properties": { + "enable": { + "description": "Enable the Date widget", + "type": "boolean" + }, + "format": { + "description": "Set the Date format", + "$ref": "#/$defs/DateFormat" + }, + "label_prefix": { + "description": "Display label prefix", + "anyOf": [ + { + "$ref": "#/$defs/LabelPrefix" + }, + { + "type": "null" + } + ] + }, + "timezone": { + "description": "TimeZone (https://docs.rs/chrono-tz/latest/chrono_tz/enum.Tz.html)\n\nUse a custom format to display additional information, i.e.:\n```json\n{\n \"Date\": {\n \"enable\": true,\n \"format\": { \"Custom\": \"%D %Z (Tokyo)\" },\n \"timezone\": \"Asia/Tokyo\"\n }\n}\n```", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "enable", + "format" + ] + }, + "DateFormat": { + "oneOf": [ + { + "description": "Month/Date/Year format (09/08/24)", + "type": "string", + "const": "MonthDateYear" + }, + { + "description": "Year-Month-Date format (2024-09-08)", + "type": "string", + "const": "YearMonthDate" + }, + { + "description": "Date-Month-Year format (8-Sep-2024)", + "type": "string", + "const": "DateMonthYear" + }, + { + "description": "Day Date Month Year format (8 September 2024)", + "type": "string", + "const": "DayDateMonthYear" + }, + { + "description": "Custom format (https://docs.rs/chrono/latest/chrono/format/strftime/index.html)", + "type": "object", + "properties": { + "Custom": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Custom" + ] + }, + { + "description": "Custom format with modifiers", + "type": "object", + "properties": { + "CustomModifiers": { + "$ref": "#/$defs/CustomModifiers" + } + }, + "additionalProperties": false, + "required": [ + "CustomModifiers" + ] + } + ] + }, + "DefaultLayout": { + "type": "string", + "enum": [ + "BSP", + "Columns", + "Rows", + "VerticalStack", + "HorizontalStack", + "UltrawideVerticalStack", + "Grid", + "RightMainVerticalStack", + "Scrolling" + ] + }, + "DisplayFormat": { + "oneOf": [ + { + "description": "Show only the application icon.", + "type": "string", + "const": "Icon" + }, + { + "description": "Show only the application name as text.", + "type": "string", + "const": "Text" + }, + { + "description": "Show both the application icon and name.", + "type": "string", + "const": "IconAndText" + } + ] + }, + "DisplayFormat2": { + "oneOf": [ + { + "description": "Show only icon", + "type": "string", + "const": "Icon" + }, + { + "description": "Show only text", + "type": "string", + "const": "Text" + }, + { + "description": "Show an icon and text for the selected element, and text on the rest", + "type": "string", + "const": "TextAndIconOnSelected" + }, + { + "description": "Show both icon and text", + "type": "string", + "const": "IconAndText" + }, + { + "description": "Show an icon and text for the selected element, and icons on the rest", + "type": "string", + "const": "IconAndTextOnSelected" + } + ] + }, + "FrameConfig": { + "type": "object", + "properties": { + "inner_margin": { + "description": "Margin inside the painted frame", + "$ref": "#/$defs/Position" + } + }, + "required": [ + "inner_margin" + ] + }, + "GroupedSpacingConfig": { + "type": "object", + "properties": { + "horizontal": { + "anyOf": [ + { + "$ref": "#/$defs/GroupedSpacingOptions" + }, + { + "type": "null" + } + ] + }, + "vertical": { + "anyOf": [ + { + "$ref": "#/$defs/GroupedSpacingOptions" + }, + { + "type": "null" + } + ] + } + } + }, + "GroupedSpacingOptions": { + "anyOf": [ + { + "type": "number", + "format": "float" + }, + { + "type": "array", + "maxItems": 2, + "minItems": 2, + "prefixItems": [ + { + "type": "number", + "format": "float" + }, + { + "type": "number", + "format": "float" + } + ] + } + ] + }, + "Grouping": { + "oneOf": [ + { + "description": "No grouping is applied", + "type": "object", + "properties": { + "kind": { + "type": "string", + "const": "None" + } + }, + "required": [ + "kind" + ] + }, + { + "description": "Widgets are grouped as a whole", + "type": "object", + "properties": { + "kind": { + "type": "string", + "const": "Bar" + } + }, + "$ref": "#/$defs/GroupingConfig", + "required": [ + "kind" + ] + }, + { + "description": "Widgets are grouped by alignment", + "type": "object", + "properties": { + "kind": { + "type": "string", + "const": "Alignment" + } + }, + "$ref": "#/$defs/GroupingConfig", + "required": [ + "kind" + ] + }, + { + "description": "Widgets are grouped individually", + "type": "object", + "properties": { + "kind": { + "type": "string", + "const": "Widget" + } + }, + "$ref": "#/$defs/GroupingConfig", + "required": [ + "kind" + ] + } + ] + }, + "GroupingConfig": { + "type": "object", + "properties": { + "rounding": { + "description": "Rounding values for the 4 corners. Can be a single or 4 values.", + "anyOf": [ + { + "$ref": "#/$defs/RoundingConfig" + }, + { + "type": "null" + } + ] + }, + "style": { + "description": "Styles for the grouping", + "anyOf": [ + { + "$ref": "#/$defs/GroupingStyle" + }, + { + "type": "null" + } + ] + }, + "transparency_alpha": { + "description": "Alpha value for the color transparency [[0-255]] (default: 200)", + "type": [ + "integer", + "null" + ], + "format": "uint8", + "maximum": 255, + "minimum": 0 + } + } + }, + "GroupingStyle": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Default" + ] + }, + { + "description": "A shadow is added under the default group. (blur: 4, offset: x-1 y-1, spread: 3)", + "type": "string", + "const": "DefaultWithShadowB4O1S3" + }, + { + "description": "A shadow is added under the default group. (blur: 4, offset: x-0 y-0, spread: 3)", + "type": "string", + "const": "DefaultWithShadowB4O0S3" + }, + { + "description": "A shadow is added under the default group. (blur: 0, offset: x-1 y-1, spread: 3)", + "type": "string", + "const": "DefaultWithShadowB0O1S3" + }, + { + "description": "A glow is added under the default group. (blur: 3, offset: x-1 y-1, spread: 2)", + "type": "string", + "const": "DefaultWithGlowB3O1S2" + }, + { + "description": "A glow is added under the default group. (blur: 3, offset: x-0 y-0, spread: 2)", + "type": "string", + "const": "DefaultWithGlowB3O0S2" + }, + { + "description": "A glow is added under the default group. (blur: 0, offset: x-1 y-1, spread: 2)", + "type": "string", + "const": "DefaultWithGlowB0O1S2" + } + ] + }, + "Hex": { + "type": "string", + "format": "color-hex" + }, + "IndividualSpacingConfig": { + "type": "object", + "properties": { + "bottom": { + "type": "number", + "format": "float" + }, + "left": { + "type": "number", + "format": "float" + }, + "right": { + "type": "number", + "format": "float" + }, + "top": { + "type": "number", + "format": "float" + } + }, + "required": [ + "top", + "bottom", + "left", + "right" + ] + }, + "KomobarTheme": { + "oneOf": [ + { + "description": "A theme from catppuccin-egui", + "type": "object", + "properties": { + "accent": { + "anyOf": [ + { + "$ref": "#/$defs/CatppuccinValue" + }, + { + "type": "null" + } + ] + }, + "auto_select_fill": { + "anyOf": [ + { + "$ref": "#/$defs/CatppuccinValue" + }, + { + "type": "null" + } + ] + }, + "auto_select_text": { + "anyOf": [ + { + "$ref": "#/$defs/CatppuccinValue" + }, + { + "type": "null" + } + ] + }, + "name": { + "description": "Name of the Catppuccin theme (theme previews: https://github.com/catppuccin/catppuccin)", + "$ref": "#/$defs/Catppuccin" + }, + "palette": { + "type": "string", + "const": "Catppuccin" + } + }, + "required": [ + "palette", + "name" + ] + }, + { + "description": "A theme from base16-egui-themes", + "type": "object", + "properties": { + "accent": { + "anyOf": [ + { + "$ref": "#/$defs/Base16Value" + }, + { + "type": "null" + } + ] + }, + "auto_select_fill": { + "anyOf": [ + { + "$ref": "#/$defs/Base16Value" + }, + { + "type": "null" + } + ] + }, + "auto_select_text": { + "anyOf": [ + { + "$ref": "#/$defs/Base16Value" + }, + { + "type": "null" + } + ] + }, + "name": { + "description": "Name of the Base16 theme (theme previews: https://tinted-theming.github.io/tinted-gallery/)", + "$ref": "#/$defs/Base16" + }, + "palette": { + "type": "string", + "const": "Base16" + } + }, + "required": [ + "palette", + "name" + ] + }, + { + "description": "A custom Base16 theme", + "type": "object", + "properties": { + "accent": { + "anyOf": [ + { + "$ref": "#/$defs/Base16Value" + }, + { + "type": "null" + } + ] + }, + "auto_select_fill": { + "anyOf": [ + { + "$ref": "#/$defs/Base16Value" + }, + { + "type": "null" + } + ] + }, + "auto_select_text": { + "anyOf": [ + { + "$ref": "#/$defs/Base16Value" + }, + { + "type": "null" + } + ] + }, + "colours": { + "description": "Colours of the custom Base16 theme palette", + "$ref": "#/$defs/Base16ColourPalette" + }, + "palette": { + "type": "string", + "const": "Custom" + } + }, + "required": [ + "palette", + "colours" + ] + } + ] + }, + "KomorebiConfig": { + "type": "object", + "properties": { + "configuration_switcher": { + "description": "Configure the Configuration Switcher widget", + "anyOf": [ + { + "$ref": "#/$defs/KomorebiConfigurationSwitcherConfig" + }, + { + "type": "null" + } + ] + }, + "focused_container": { + "description": "Configure the Focused Container widget", + "anyOf": [ + { + "$ref": "#/$defs/KomorebiFocusedContainerConfig" + }, + { + "type": "null" + } + ] + }, + "layout": { + "description": "Configure the Layout widget", + "anyOf": [ + { + "$ref": "#/$defs/KomorebiLayoutConfig" + }, + { + "type": "null" + } + ] + }, + "locked_container": { + "description": "Configure the Locked Container widget", + "anyOf": [ + { + "$ref": "#/$defs/KomorebiLockedContainerConfig" + }, + { + "type": "null" + } + ] + }, + "workspace_layer": { + "description": "Configure the Workspace Layer widget", + "anyOf": [ + { + "$ref": "#/$defs/KomorebiWorkspaceLayerConfig" + }, + { + "type": "null" + } + ] + }, + "workspaces": { + "description": "Configure the Workspaces widget", + "anyOf": [ + { + "$ref": "#/$defs/KomorebiWorkspacesConfig" + }, + { + "type": "null" + } + ] + } + } + }, + "KomorebiConfigurationSwitcherConfig": { + "type": "object", + "properties": { + "configurations": { + "description": "A map of display friendly name => path to configuration.json", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "enable": { + "description": "Enable the Komorebi Configurations widget", + "type": "boolean" + } + }, + "required": [ + "enable", + "configurations" + ] + }, + "KomorebiFocusedContainerConfig": { + "type": "object", + "properties": { + "display": { + "description": "Display format of the currently focused container", + "anyOf": [ + { + "$ref": "#/$defs/DisplayFormat2" + }, + { + "type": "null" + } + ] + }, + "enable": { + "description": "Enable the Komorebi Focused Container widget", + "type": "boolean" + }, + "show_icon": { + "description": "DEPRECATED: use 'display' instead (Show the icon of the currently focused container)", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "enable" + ] + }, + "KomorebiLayout": { + "anyOf": [ + { + "$ref": "#/$defs/DefaultLayout" + }, + { + "type": "null" + }, + { + "type": "null" + }, + { + "type": "null" + }, + { + "type": "null" + } + ] + }, + "KomorebiLayoutConfig": { + "type": "object", + "properties": { + "display": { + "description": "Display format of the current layout", + "anyOf": [ + { + "$ref": "#/$defs/DisplayFormat2" + }, + { + "type": "null" + } + ] + }, + "enable": { + "description": "Enable the Komorebi Layout widget", + "type": "boolean" + }, + "options": { + "description": "List of layout options", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/$defs/KomorebiLayout" + } + } + }, + "required": [ + "enable" + ] + }, + "KomorebiLockedContainerConfig": { + "type": "object", + "properties": { + "display": { + "description": "Display format of the current locked state", + "anyOf": [ + { + "$ref": "#/$defs/DisplayFormat2" + }, + { + "type": "null" + } + ] + }, + "enable": { + "description": "Enable the Komorebi Locked Container widget", + "type": "boolean" + }, + "show_when_unlocked": { + "description": "Show the widget event if the layer is unlocked", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "enable" + ] + }, + "KomorebiWorkspaceLayerConfig": { + "type": "object", + "properties": { + "display": { + "description": "Display format of the current layer", + "anyOf": [ + { + "$ref": "#/$defs/DisplayFormat2" + }, + { + "type": "null" + } + ] + }, + "enable": { + "description": "Enable the Komorebi Workspace Layer widget", + "type": "boolean" + }, + "show_when_tiling": { + "description": "Show the widget event if the layer is Tiling", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "enable" + ] + }, + "KomorebiWorkspacesConfig": { + "type": "object", + "properties": { + "display": { + "description": "Display format of the workspace", + "anyOf": [ + { + "$ref": "#/$defs/WorkspacesDisplayFormat" + }, + { + "type": "null" + } + ] + }, + "enable": { + "description": "Enable the Komorebi Workspaces widget", + "type": "boolean" + }, + "hide_empty_workspaces": { + "description": "Hide workspaces without any windows", + "type": "boolean" + } + }, + "required": [ + "enable", + "hide_empty_workspaces" + ] + }, + "LabelPrefix": { + "oneOf": [ + { + "description": "Show no prefix", + "type": "string", + "const": "None" + }, + { + "description": "Show an icon", + "type": "string", + "const": "Icon" + }, + { + "description": "Show text", + "type": "string", + "const": "Text" + }, + { + "description": "Show an icon and text", + "type": "string", + "const": "IconAndText" + } + ] + }, + "MemoryConfig": { + "type": "object", + "properties": { + "auto_select_over": { + "description": "Select when the current percentage is over this value [[1-100]]", + "type": [ + "integer", + "null" + ], + "format": "uint8", + "maximum": 255, + "minimum": 0 + }, + "data_refresh_interval": { + "description": "Data refresh interval (default: 10 seconds)", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0 + }, + "enable": { + "description": "Enable the Memory widget", + "type": "boolean" + }, + "label_prefix": { + "description": "Display label prefix", + "anyOf": [ + { + "$ref": "#/$defs/LabelPrefix" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "enable" + ] + }, + "MonitorConfig": { + "type": "object", + "properties": { + "index": { + "description": "Komorebi monitor index of the monitor on which to render the bar", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + "work_area_offset": { + "description": "Automatically apply a work area offset for this monitor to accommodate the bar", + "anyOf": [ + { + "$ref": "#/$defs/Rect" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "index" + ] + }, + "MonitorConfigOrIndex": { + "anyOf": [ + { + "description": "The monitor index where you want the bar to show", + "type": "integer", + "format": "uint", + "minimum": 0 + }, + { + "description": "The full monitor options with the index and an optional work_area_offset", + "$ref": "#/$defs/MonitorConfig" + } + ] + }, + "NetworkConfig": { + "type": "object", + "properties": { + "activity_left_padding": { + "description": "Characters to reserve for received and transmitted activity", + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 0 + }, + "auto_select": { + "description": "Select when the value is over a limit (1MiB is 1048576 bytes (1024*1024))", + "anyOf": [ + { + "$ref": "#/$defs/NetworkSelectConfig" + }, + { + "type": "null" + } + ] + }, + "data_refresh_interval": { + "description": "Data refresh interval (default: 10 seconds)", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0 + }, + "enable": { + "description": "Enable the Network widget", + "type": "boolean" + }, + "label_prefix": { + "description": "Display label prefix", + "anyOf": [ + { + "$ref": "#/$defs/LabelPrefix" + }, + { + "type": "null" + } + ] + }, + "show_activity": { + "description": "Show received and transmitted activity", + "type": "boolean" + }, + "show_default_interface": { + "description": "Show default interface", + "type": [ + "boolean", + "null" + ] + }, + "show_total_activity": { + "description": "Show total received and transmitted activity", + "type": "boolean" + } + }, + "required": [ + "enable", + "show_total_activity", + "show_activity" + ] + }, + "NetworkSelectConfig": { + "type": "object", + "properties": { + "received_over": { + "description": "Select the received data when it's over this value", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0 + }, + "total_received_over": { + "description": "Select the total received data when it's over this value", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0 + }, + "total_transmitted_over": { + "description": "Select the total transmitted data when it's over this value", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0 + }, + "transmitted_over": { + "description": "Select the transmitted data when it's over this value", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0 + } + } + }, + "Position": { + "type": "object", + "properties": { + "x": { + "description": "X coordinate", + "type": "number", + "format": "float" + }, + "y": { + "description": "Y coordinate", + "type": "number", + "format": "float" + } + }, + "required": [ + "x", + "y" + ] + }, + "PositionConfig": { + "type": "object", + "properties": { + "end": { + "description": "The desired size of the bar from the starting position (usually monitor width x desired height)", + "anyOf": [ + { + "$ref": "#/$defs/Position" + }, + { + "type": "null" + } + ] + }, + "start": { + "description": "The desired starting position of the bar (0,0 = top left of the screen)", + "anyOf": [ + { + "$ref": "#/$defs/Position" + }, + { + "type": "null" + } + ] + } + } + }, + "Rect": { + "type": "object", + "properties": { + "bottom": { + "type": "integer", + "format": "int32" + }, + "left": { + "type": "integer", + "format": "int32" + }, + "right": { + "type": "integer", + "format": "int32" + }, + "top": { + "type": "integer", + "format": "int32" + } + }, + "required": [ + "left", + "top", + "right", + "bottom" + ] + }, + "Rgb": { + "type": "object", + "properties": { + "b": { + "description": "Blue", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "g": { + "description": "Green", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "r": { + "description": "Red", + "type": "integer", + "format": "uint32", + "minimum": 0 + } + }, + "required": [ + "r", + "g", + "b" + ] + }, + "RoundingConfig": { + "anyOf": [ + { + "description": "All 4 corners are the same", + "type": "number", + "format": "float" + }, + { + "description": "All 4 corners are custom. Order: NW, NE, SW, SE", + "type": "array", + "items": { + "type": "number", + "format": "float" + }, + "maxItems": 4, + "minItems": 4 + } + ] + }, + "SpacingKind": { + "anyOf": [ + { + "type": "number", + "format": "float" + }, + { + "$ref": "#/$defs/IndividualSpacingConfig" + }, + { + "$ref": "#/$defs/GroupedSpacingConfig" + } + ] + }, + "StorageConfig": { + "type": "object", + "properties": { + "auto_hide_under": { + "description": "Hide when the current percentage is under this value [[1-100]]", + "type": [ + "integer", + "null" + ], + "format": "uint8", + "maximum": 255, + "minimum": 0 + }, + "auto_select_over": { + "description": "Select when the current percentage is over this value [[1-100]]", + "type": [ + "integer", + "null" + ], + "format": "uint8", + "maximum": 255, + "minimum": 0 + }, + "data_refresh_interval": { + "description": "Data refresh interval (default: 10 seconds)", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0 + }, + "enable": { + "description": "Enable the Storage widget", + "type": "boolean" + }, + "label_prefix": { + "description": "Display label prefix", + "anyOf": [ + { + "$ref": "#/$defs/LabelPrefix" + }, + { + "type": "null" + } + ] + }, + "show_read_only_disks": { + "description": "Show disks that are read only. (default: false)", + "type": [ + "boolean", + "null" + ] + }, + "show_removable_disks": { + "description": "Show removable disks. (default: true)", + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "enable" + ] + }, + "TimeConfig": { + "type": "object", + "properties": { + "changing_icon": { + "description": "Change the icon depending on the time. The default icon is used between 8:30 and 12:00. (default: false)", + "type": [ + "boolean", + "null" + ] + }, + "enable": { + "description": "Enable the Time widget", + "type": "boolean" + }, + "format": { + "description": "Set the Time format", + "$ref": "#/$defs/TimeFormat" + }, + "label_prefix": { + "description": "Display label prefix", + "anyOf": [ + { + "$ref": "#/$defs/LabelPrefix" + }, + { + "type": "null" + } + ] + }, + "timezone": { + "description": "TimeZone (https://docs.rs/chrono-tz/latest/chrono_tz/enum.Tz.html)\n\nUse a custom format to display additional information, i.e.:\n```json\n{\n \"Time\": {\n \"enable\": true,\n \"format\": { \"Custom\": \"%T %Z (Tokyo)\" },\n \"timezone\": \"Asia/Tokyo\"\n }\n}\n```", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "enable", + "format" + ] + }, + "TimeFormat": { + "oneOf": [ + { + "description": "Twelve-hour format (with seconds)", + "type": "string", + "const": "TwelveHour" + }, + { + "description": "Twelve-hour format (without seconds)", + "type": "string", + "const": "TwelveHourWithoutSeconds" + }, + { + "description": "Twenty-four-hour format (with seconds)", + "type": "string", + "const": "TwentyFourHour" + }, + { + "description": "Twenty-four-hour format (without seconds)", + "type": "string", + "const": "TwentyFourHourWithoutSeconds" + }, + { + "description": "Twenty-four-hour format displayed as a binary clock with circles (with seconds) (https://en.wikipedia.org/wiki/Binary_clock)", + "type": "string", + "const": "BinaryCircle" + }, + { + "description": "Twenty-four-hour format displayed as a binary clock with rectangles (with seconds) (https://en.wikipedia.org/wiki/Binary_clock)", + "type": "string", + "const": "BinaryRectangle" + }, + { + "description": "Custom format (https://docs.rs/chrono/latest/chrono/format/strftime/index.html)", + "type": "object", + "properties": { + "Custom": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Custom" + ] + } + ] + }, + "UpdateConfig": { + "type": "object", + "properties": { + "data_refresh_interval": { + "description": "Data refresh interval (default: 12 hours)", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0 + }, + "enable": { + "description": "Enable the Update widget", + "type": "boolean" + }, + "label_prefix": { + "description": "Display label prefix", + "anyOf": [ + { + "$ref": "#/$defs/LabelPrefix" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "enable" + ] + }, + "WidgetConfig": { + "oneOf": [ + { + "type": "object", + "properties": { + "Applications": { + "$ref": "#/$defs/ApplicationsConfig" + } + }, + "additionalProperties": false, + "required": [ + "Applications" + ] + }, + { + "type": "object", + "properties": { + "Battery": { + "$ref": "#/$defs/BatteryConfig" + } + }, + "additionalProperties": false, + "required": [ + "Battery" + ] + }, + { + "type": "object", + "properties": { + "Cpu": { + "$ref": "#/$defs/CpuConfig" + } + }, + "additionalProperties": false, + "required": [ + "Cpu" + ] + }, + { + "type": "object", + "properties": { + "Date": { + "$ref": "#/$defs/DateConfig" + } + }, + "additionalProperties": false, + "required": [ + "Date" + ] + }, + { + "type": "object", + "properties": { + "Komorebi": { + "$ref": "#/$defs/KomorebiConfig" + } + }, + "additionalProperties": false, + "required": [ + "Komorebi" + ] + }, + { + "type": "object", + "properties": { + "Memory": { + "$ref": "#/$defs/MemoryConfig" + } + }, + "additionalProperties": false, + "required": [ + "Memory" + ] + }, + { + "type": "object", + "properties": { + "Network": { + "$ref": "#/$defs/NetworkConfig" + } + }, + "additionalProperties": false, + "required": [ + "Network" + ] + }, + { + "type": "object", + "properties": { + "Storage": { + "$ref": "#/$defs/StorageConfig" + } + }, + "additionalProperties": false, + "required": [ + "Storage" + ] + }, + { + "type": "object", + "properties": { + "Time": { + "$ref": "#/$defs/TimeConfig" + } + }, + "additionalProperties": false, + "required": [ + "Time" + ] + }, + { + "type": "object", + "properties": { + "Update": { + "$ref": "#/$defs/UpdateConfig" + } + }, + "additionalProperties": false, + "required": [ + "Update" + ] + } + ] + }, + "WorkspacesDisplayFormat": { + "anyOf": [ + { + "description": "Show all icons only", + "type": "string", + "const": "AllIcons" + }, + { + "description": "Show both all icons and text", + "type": "string", + "const": "AllIconsAndText" + }, + { + "description": "Show all icons and text for the selected element, and all icons on the rest", + "type": "string", + "const": "AllIconsAndTextOnSelected" + }, + { + "$ref": "#/$defs/DisplayFormat2" + } + ] + } + } +} diff --git a/schema.json b/schema.json index c8cba531..ffec640c 100644 --- a/schema.json +++ b/schema.json @@ -1,7 +1,7 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "StaticConfig", - "description": "The `komorebi.json` static configuration file reference for `v0.1.39`", + "description": "The `komorebi.json` static configuration file reference for komorebi for Mac `v0.1.0`\n\n`\"$schema\": \"https://komorebi-for-mac.lgug2z.com/komorebi.0.1.0.schema.json\"`", "type": "object", "properties": { "app_specific_configuration_path": { diff --git a/shell.nix b/shell.nix index 6ea338e5..94032484 100644 --- a/shell.nix +++ b/shell.nix @@ -14,6 +14,7 @@ mkShell { jq just prettier + wrangler python311Packages.mkdocs-material python311Packages.mkdocs-macros