Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.39k stars 696 forks source link

Document which modules have a "format-alt" option available #1228

Open cinerea0 opened 3 years ago

cinerea0 commented 3 years ago

In my configuration, I have the following settings for the battery module:

"battery": {
    "states": {
        "good": 95,
        "warning": 30,
        "critical": 15
    },
    "format": "{capacity}% {icon}",
    "format-charging": "{capacity}% ⚡",
    "format-alt": "{time} {icon}",
    "format-icons": ["", "", "", "", ""]
}

While the format-alt option is not documented in the wiki or the man page, it works to provide an alternate format that can be switched to with just a click on the module with no further configuration. I attempted to do the same with the mpd module as follows:

"mpd": {
    "server": "@mpd",
    "port": 6600,
    "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) 🎵",
    "format-disconnected": "Disconnected 🎵",
    "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped 🎵",
    "format-alt": "{stateIcon} {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) 🎵",
    "interval": 10,
    "consume-icons": {
        "on": " " // Icon shows only when "consume" is on
    },
    "random-icons": {
        "on": " "
    },
    "repeat-icons": {
        "on": " "
    },
    "single-icons": {
        "on": "1 "
    },
    "state-icons": {
        "paused": "",
        "playing": ""
    },
    "tooltip-format": "MPD (connected)",
    "tooltip-format-disconnected": "MPD (disconnected)"
}

However, clicking on the module does not switch to the alternate format. My assumption is that the battery module supports the format-alt option while the mpd module does not. As such, I think it would be helpful if it were listed on the man pages and/or the wiki pages of the modules whether or not they support that option.

ghost commented 2 years ago

just stumbled upon this - I am currently creating a yml (sic) validator for waybar configs, so here's an incomplete (?) list of all those I check for:

There are a couple of unducumented settings per module, maybe if someone's interested, I'll create a repo for the validator code.