mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-16 22:31:03 +02:00
feat: new sway-mode module (#671)
* feat: add sway-mode module * refactor: Avoid making multiple connections to SwayIPC Now `sway::Client` is store in `ironbar.clients`, and allow dynamically registering event listeners, instead of hardcoding events for Workspace updates. Remove the use of `swayipc::Connection` from `sway-mode` module, and replace it with the new event listener system. #671
This commit is contained in:
parent
4f2f890c93
commit
e307e15dc4
11 changed files with 411 additions and 72 deletions
|
@ -35,6 +35,7 @@
|
|||
- [Network Manager](network-manager)
|
||||
- [Notifications](notifications)
|
||||
- [Script](script)
|
||||
- [Sway-mode](sway-mode)
|
||||
- [Sys_Info](sys-info)
|
||||
- [Tray](tray)
|
||||
- [Upower](upower)
|
||||
|
|
78
docs/modules/Sway-mode.md
Normal file
78
docs/modules/Sway-mode.md
Normal file
|
@ -0,0 +1,78 @@
|
|||
Displays the current sway mode in a label. If the current sway mode is
|
||||
"default", nothing is displayed.
|
||||
|
||||
> [!NOTE]
|
||||
> This module only works under the [Sway](https://swaywm.org/) compositor.
|
||||
|
||||
## Configuration
|
||||
|
||||
> Type: `sway-mode`
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
| --------------------- | ------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `truncate` | `'start'` or `'middle'` or `'end'` or `Map` | `null` | The location of the ellipses and where to truncate text from. Leave null to avoid truncating. Use the long-hand `Map` version if specifying a length. |
|
||||
| `truncate.mode` | `'start'` or `'middle'` or `'end'` | `null` | The location of the ellipses and where to truncate text from. Leave null to avoid truncating. |
|
||||
| `truncate.length` | `integer` | `null` | The fixed width (in chars) of the widget. Leave blank to let GTK automatically handle. |
|
||||
| `truncate.max_length` | `integer` | `null` | The maximum number of characters before truncating. Leave blank to let GTK automatically handle. |
|
||||
|
||||
<details>
|
||||
<summary>JSON</summary>
|
||||
|
||||
```json
|
||||
{
|
||||
"end": [
|
||||
{
|
||||
"type": "sway-mode",
|
||||
"truncate": "start"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>TOML</summary>
|
||||
|
||||
```toml
|
||||
[[end]]
|
||||
type = "sway-mode"
|
||||
truncate = "start"
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>YAML</summary>
|
||||
|
||||
```yaml
|
||||
end:
|
||||
- type: "sway-mode"
|
||||
truncate: "start"
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Corn</summary>
|
||||
|
||||
```corn
|
||||
{
|
||||
end = [
|
||||
{
|
||||
type = "sway-mode"
|
||||
truncate = "start"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## Styling
|
||||
|
||||
| Selector | Description |
|
||||
| ------------ | ---------------------- |
|
||||
| `.sway_mode` | Sway mode label widget |
|
||||
|
||||
For more information on styling, please see the [styling guide](styling-guide).
|
Loading…
Add table
Add a link
Reference in a new issue