> [!NOTE] > This module requires your user is in the `input` group. > [!IMPORTANT] > The keyboard layout feature is only available on Sway and Hyprland. Displays the toggle state of the capslock, num lock and scroll lock keys, and the current keyboard layout. ![Screenshot of keyboard widget](https://f.jstanger.dev/github/ironbar/keys.png) ## Configuration > Type: `keyboard` | Name | Type | Default | Description | | ------------------ | ------------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------- | | `show_caps` | `boolean` | `true` | Whether to show capslock indicator. | | `show_num` | `boolean` | `true` | Whether to show num lock indicator. | | `show_scroll` | `boolean` | `true` | Whether to show scroll lock indicator. | | `show_layout` | `boolean` | `true` | Whether to show the keyboard layout button. | | `icon_size` | `integer` | `32` | Size to render icon at (image icons only). | | `icons.caps_on` | `string` or [image](images) | `σ°ͺ›` | Icon to show for enabled capslock indicator. | | `icons.caps_off` | `string` or [image](images) | `''` | Icon to show for disabled capslock indicator. | | `icons.num_on` | `string` or [image](images) | `ο“·` | Icon to show for enabled num lock indicator. | | `icons.num_off` | `string` or [image](images) | `''` | Icon to show for disabled num lock indicator. | | `icons.scroll_on` | `string` or [image](images) | `` | Icon to show for enabled scroll lock indicator. | | `icons.scroll_off` | `string` or [image](images) | `''` | Icon to show for disabled scroll lock indicator. | | `icons.layout_map` | `Map` | `{}` | Map of icons or labels to show for a particular keyboard layout. Layouts use their actual name if not present in the map. | | `seat` | `string` | `seat0` | ID of the Wayland seat to attach to. |
JSON ```json { "end": [ { "type": "keyboard", "show_scroll": false, "icons": { "caps_on": "σ°ͺ›", "layout_map": { "English (US)": "πŸ‡ΊπŸ‡Έ", "Ukrainian": "πŸ‡ΊπŸ‡¦" } } } ] } ```
TOML ```toml [[end]] type = "keyboard" show_scroll = false [end.icons] caps_on = "σ°ͺ›" [end.icons.layout_map] "English (US)" = "πŸ‡ΊπŸ‡Έ" Ukrainian = "πŸ‡ΊπŸ‡¦" ```
YAML ```yaml end: - type: keyboard show_scroll: false icons: caps_on: σ°ͺ› layout_map: "English (US)": πŸ‡ΊπŸ‡Έ Ukrainian: πŸ‡ΊπŸ‡¦ ```
Corn ```corn { end = [ { type = "keyboard" show_scroll = false icons.caps_on = "σ°ͺ›" icons.layout_map.'English (US)' = "πŸ‡ΊπŸ‡Έ" icons.layout_map.Ukrainian = "πŸ‡ΊπŸ‡¦" } ] } ```
## Styling | Selector | Description | | -------------------------- | ------------------------------------------ | | `.keyboard` | Keys box container widget. | | `.keyboard .key` | Individual key indicator container widget. | | `.keyboard .key.enabled` | Key indicator where key is toggled on. | | `.keyboard .key.caps` | Capslock key indicator. | | `.keyboard .key.num` | Num lock key indicator. | | `.keyboard .key.scroll` | Scroll lock key indicator. | | `.keyboard .key.image` | Key indicator image icon. | | `.keyboard .key.text-icon` | Key indicator textual icon. | | `.keyboard .layout` | Keyboard layout indicator. | For more information on styling, please see the [styling guide](styling-guide).