Add support for custom formats with labels
Hi! I started switching to Waybar at the weekend and found this to replace what I had for Polybar previously. It works great—thanks for merging #29 so quickly btw—but ideally ***I'd like to show counts separately***.
I couldn't find a way to get Waybar passing anything from the "real" `format` option in the bar config, so instead I've hacked together some basic "label" parsing. It supports a custom prefix/suffix (separated by `:`) which allows for per-count auto-hiding icons, but at the cost of a *really* ugly sed block.
## New CLI args
* `-f, --format`
* `-t, --tooltip`
## Supported Labels
* `{aur}`
* `{dev}`
* `{pacman}`
* `{total}`
## Examples
### New defaults
```jsonc
"exec": "waybar-updates",
// All examples are based on this:
"format": "{icon}{}",
"format-icons": {
"pending-updates": " ",
"updated": ""
}
```

### Custom prefix and suffix
```jsonc
"exec": "waybar-updates --format '{total}{ (+:aur: AUR)}'",
```

### Multiline Pacman+AUR example with icons
```jsonc
"exec": "waybar-updates -df '{ :pacman:\n }{ :aur}'",
```

### Showing only package counts in the tooltip
```jsonc
"exec": "waybar-updates --tooltip '{ :pacman}{ :aur}{ :dev}'",
```

### Showing all counts individually (and hiding them in the tooltip)
```jsonc
"exec": "waybar-updates -df '{pacman}{ :aur} { :dev}' -t '{}'",
```

合并状态:未合并 关闭于 2024-08-07 9 条评论