2023-01-28 02:18:44 +03:00
> ⚠ **This module is currently only supported on Sway and Hyprland**
2022-11-07 01:52:21 +03:00
2023-01-28 02:18:44 +03:00
Shows all current workspaces. Clicking a workspace changes focus to it.
2022-11-07 01:52:21 +03:00
![Screenshot showing workspaces widget using custom icons with browser workspace focused ](https://user-images.githubusercontent.com/5057870/184540156-26cfe4ec-ab8d-4e0f-a883-8b641025366b.png )
## Configuration
> Type: `workspaces`
2023-05-09 12:05:26 +03:00
| Name | Type | Default | Description |
|----------------|---------------------------------------|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `name_map` | `Map<string, string or image>` | `{}` | A map of actual workspace names to their display labels/images. Workspaces use their actual name if not present in the map. See [here ](images ) for information on images. |
| `favorites` | `Map<string, string[]>` or `string[]` | `[]` | Workspaces to always show. This can be for all monitors, or a map to set per monitor. |
| `hidden` | `string[]` | `[]` | A list of workspace names to never show |
| `icon_size` | `integer` | `32` | Size to render icon at (image icons only). |
| `all_monitors` | `boolean` | `false` | Whether to display workspaces from all monitors. When `false` , only shows workspaces on the current monitor. |
| `sort` | `'added'` or `'alphanumeric'` | `alphanumeric` | The method used for sorting workspaces. `added` always appends to the end, `alphanumeric` sorts by number/name. |
2022-11-07 01:52:21 +03:00
< details >
< summary > JSON< / summary >
```json
{
"end": [
{
"type": "workspaces",
"name_map": {
"1": "",
"2": "",
"3": ""
},
2023-05-09 12:05:26 +03:00
"favorites": ["1", "2", "3"],
2022-11-07 01:52:21 +03:00
"all_monitors": false
}
]
}
```
< / details >
< details >
< summary > TOML< / summary >
```toml
[[end]]
type = "workspaces"
all_monitors = false
2023-05-09 12:05:26 +03:00
favorites = ["1", "2", "3"]
2022-11-07 01:52:21 +03:00
[[end.name_map]]
1 = ""
2 = ""
3 = ""
```
< / details >
< details >
< summary > YAML< / summary >
```yaml
end:
- type: "workspaces"
name_map:
1: ""
2: ""
3: ""
2023-05-09 12:05:26 +03:00
favorites:
- "1"
- "2"
- "3"
2022-11-07 01:52:21 +03:00
all_monitors: false
```
< / details >
< details >
< summary > Corn< / summary >
```corn
{
2023-01-30 01:48:42 +03:00
end = [
{
type = "workspaces",
name_map.1 = ""
name_map.2 = ""
name_map.3 = ""
2023-05-09 12:05:26 +03:00
favorites = [ "1" "2" "3" ]
2023-01-30 01:48:42 +03:00
all_monitors = false
}
]
2022-11-07 01:52:21 +03:00
}
```
< / details >
## Styling
2023-06-13 00:25:40 +03:00
| Selector | Description |
|--------------------------------|--------------------------------------|
| `.workspaces` | Workspaces widget box |
| `.workspaces .item` | Workspace button |
| `.workspaces .item.focused` | Workspace button (workspace focused) |
2023-08-25 05:18:07 +03:00
| `.workspaces .item.visible` | Workspace button (workspace visible, including focused) |
2023-08-25 01:29:16 +03:00
| `.workspaces .item.inactive` | Workspace button (favourite, not currently open)
2023-06-13 00:25:40 +03:00
| `.workspaces .item .icon` | Workspace button icon (any type) |
| `.workspaces .item .text-icon` | Workspace button icon (textual only) |
| `.workspaces .item .image` | Workspace button icon (image only) |
2023-05-06 02:40:06 +03:00
2023-05-09 12:05:26 +03:00
For more information on styling, please see the [styling guide ](styling-guide ).