docs: align man pages with code + fill documentation gaps (0.16.0 audit)
A full man<->code consistency audit surfaced options, format placeholders
and CSS classes that were implemented but undocumented, documented but not
implemented (some causing fmt crashes when copied from examples), and
defaults that disagreed with the code. This aligns the docs with the code
and fixes a few genuine code gaps.
Docs:
- Add the missing waybar-user(5) man page (and register it in meson.build)
- Document previously-undocumented options/placeholders/CSS across many
modules (custom image-path/image-name/icon-size, graph_type/width/
datapoints; battery smooth-power; wireplumber format-source/only-physical;
mpris {position}/prefer-album-artist; network {signalStrengthApp}/compact
bandwidth; pulseaudio {source_volume}/{source_desc}; upower {temperature}/
{model}/{native-path}; wwan {power_state}/{imei}; tray ignore-list; and
many CSS state classes: .sink-muted, .source-muted, .workspace-hover, etc.)
- Correct documented defaults to match the code (hyprland format {name},
gamemode {count}, cpu-graph interval 5, cava input_delay 4, niri taskbar
icon-size 16, disk/gps/wayfire formats, menu-actions object type, ...)
- Remove placeholders/options that do not apply (custom-graph {icon}/format/
format-icons/rotate) and fix crashing examples (wwan {mode}, gps
format-no-fix); note cava background/foreground/continuous_rendering are
cava-config-file options
Code:
- bluetooth: accept the documented `controller` key as a synonym of
`controller-alias` (the option was silently ignored)
- mango/workspaces: supply the documented `{name}` fmt arg (was missing ->
fmt::format threw)
- privacy: read `tooltip` as a bool (was guarded on isString(), so the
documented `tooltip: false` was silently ignored)
All man pages validated with scdoc 1.11.4. Not compiled locally (no gtkmm);
C++ build relies on CI.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -87,6 +87,18 @@ auto isChildPath(const std::string& child, const std::string& parent) -> bool {
|
||||
return child.starts_with(parent);
|
||||
}
|
||||
|
||||
// Returns the configured controller alias, accepting either the documented "controller" key or
|
||||
// its "controller-alias" synonym ("controller-alias" takes precedence when both are set).
|
||||
auto getConfiguredControllerAlias(const Json::Value& config) -> std::optional<std::string> {
|
||||
if (config["controller-alias"].isString()) {
|
||||
return config["controller-alias"].asString();
|
||||
}
|
||||
if (config["controller"].isString()) {
|
||||
return config["controller"].asString();
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// Returns true only if some configured format/tooltip string actually references the peripheral
|
||||
// battery placeholder. The GATT battery scan issues over-the-air BLE reads, so it must stay
|
||||
// opt-in: users who don't display {device_battery_percentage_peripheral} pay zero cost.
|
||||
@@ -176,9 +188,8 @@ waybar::modules::Bluetooth::Bluetooth(const std::string& id, const Json::Value&
|
||||
}
|
||||
|
||||
if (cur_controller_ = findCurController(); !cur_controller_) {
|
||||
if (config_["controller-alias"].isString()) {
|
||||
spdlog::warn("no bluetooth controller found with alias '{}'",
|
||||
config_["controller-alias"].asString());
|
||||
if (auto controller_alias = getConfiguredControllerAlias(config_)) {
|
||||
spdlog::warn("no bluetooth controller found with alias '{}'", *controller_alias);
|
||||
} else {
|
||||
spdlog::warn("no bluetooth controller found");
|
||||
}
|
||||
@@ -372,9 +383,9 @@ auto waybar::modules::Bluetooth::onObjectAdded(GDBusObjectManager* manager, GDBu
|
||||
ControllerInfo info;
|
||||
Bluetooth* bt = static_cast<Bluetooth*>(user_data);
|
||||
|
||||
auto controller_alias = getConfiguredControllerAlias(bt->config_);
|
||||
if (!bt->cur_controller_.has_value() && bt->getControllerProperties(object, info) &&
|
||||
(!bt->config_["controller-alias"].isString() ||
|
||||
bt->config_["controller-alias"].asString() == info.alias)) {
|
||||
(!controller_alias.has_value() || controller_alias.value() == info.alias)) {
|
||||
bt->cur_controller_ = std::move(info);
|
||||
bt->dp.emit();
|
||||
}
|
||||
@@ -634,9 +645,9 @@ auto waybar::modules::Bluetooth::findCurController() -> std::optional<Controller
|
||||
for (GList* l = objects; l != NULL; l = l->next) {
|
||||
GDBusObject* object = G_DBUS_OBJECT(l->data);
|
||||
ControllerInfo info;
|
||||
auto controller_alias = getConfiguredControllerAlias(config_);
|
||||
if (getControllerProperties(object, info) &&
|
||||
(!config_["controller-alias"].isString() ||
|
||||
config_["controller-alias"].asString() == info.alias)) {
|
||||
(!controller_alias.has_value() || controller_alias.value() == info.alias)) {
|
||||
controller_info = std::move(info);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user