corsairctl/docs/waybar-example.md

61 lines
1.2 KiB
Markdown

# Waybar-Integration
## Modul-Konfiguration (`~/.config/waybar/config`)
```json
"custom/headset": {
"exec": "corsairctl json",
"return-type": "json",
"interval": 30,
"format": "{}",
"on-click": "corsairctl sidetone 0",
"on-click-right": "corsairctl sidetone 10"
}
```
## Styling (`~/.config/waybar/style.css`)
```css
#custom-headset {
padding: 0 8px;
}
#custom-headset.charging {
color: #a6e3a1;
}
#custom-headset.normal {
color: #cdd6f4;
}
#custom-headset.warning {
color: #f9e2af;
}
#custom-headset.low,
#custom-headset.critical {
color: #f38ba8;
}
#custom-headset.offline {
color: #6c7086;
}
```
## JSON-Output Beispiel
```json
{"text": "󰋋 64%", "tooltip": "HS80: 64% — Charging", "class": "charging", "percentage": 64}
```
## CSS-Klassen
| Klasse | Bedingung |
|------------|--------------------------------|
| `charging` | Lädt oder voll geladen |
| `normal` | Entladen, > 30% |
| `warning` | Entladen, 16-30% |
| `critical` | Entladen, ≤ 15% |
| `low` | Gerät meldet "Low" |
| `offline` | Headset ausgeschaltet/getrennt |