coffebar / waybar-module-pacman-updates

waybar module for Arch to show system updates available
GNU General Public License v3.0
44 stars 4 forks source link

Hide module if no updates #12

Closed beucismis closed 2 weeks ago

beucismis commented 2 weeks ago

Hi, I'm try...

waybar-module-pacman-updates | jq .text

If outpus is "0", hide. With waybar exec-if state. But not working.

coffebar commented 2 weeks ago

maybe you want just --no-zero-output option and set no icon when no updates?

beucismis commented 2 weeks ago

Yep. My config:

"custom/updates": {
  "format": "UP: {}",
  "return-type": "json",
  "exec": "waybar-module-pacman-updates",
  "exec-if": "waybar-module-pacman-updates --no-zero-output | jq .text",
}
coffebar commented 2 weeks ago

try this:

    "custom/updates": {
        "format": "{} {icon}",
        "return-type": "json",
        "format-icons": {
            "has-updates": "󱍷",
            "updated": ""
        },
        "exec-if": "which waybar-module-pacman-updates",
        "exec": "waybar-module-pacman-updates --no-zero-output"
    }
beucismis commented 2 weeks ago

Not exactly what I wanted... Thanks.

michaeljaeger95 commented 2 days ago

I'm sorry for necrobumping, but would you consider adding this tip to the readme? I think this is an issue several people might have (I'm eveidently at least the second) and not everyone will figure out to look in closed issues for this.

coffebar commented 2 days ago

done