From d7274a041f331efd32247c54dddbcb20f367e6df Mon Sep 17 00:00:00 2001 From: Lena Date: Sat, 11 Oct 2025 16:14:44 +0200 Subject: [PATCH] improve manpage --- man/waybar-wwan.5.scd | 77 +++++++++++++++++++++++++++++++++++++------ src/modules/wwan.cpp | 5 ++- 2 files changed, 71 insertions(+), 11 deletions(-) diff --git a/man/waybar-wwan.5.scd b/man/waybar-wwan.5.scd index 4363911b..6f5168cd 100644 --- a/man/waybar-wwan.5.scd +++ b/man/waybar-wwan.5.scd @@ -25,9 +25,42 @@ libmm-glib lives in: # CONFIGURATION *format*: ++ + typeof: string ++ + default: *{state}* ++ + The format, how information should be displayed. This format is used when other formats aren't specified. + +*format-failed*: ++ typeof: string ++ - default: {glyph} ++ - The text format. + This format is used when the modem cannot start. + +*format-locked*: ++ + typeof: string ++ + This format is used when the SIM on the modem is locked. + +*format-disabled*: ++ + typeof: string ++ + This format is used when the modem is disabled. + +*format-enabled*: ++ + typeof: string ++ + This format is used when the modem is enabled, but isn't registered to any carrier network. + +*format-searching*: ++ + typeof: string ++ + This format is used when the modem is looking for a carrier network to register to. + +*format-registered*: ++ + typeof: string ++ + This format is used when the modem is registered to a network, but no data connection is active. + +*format-connected*: ++ + typeof: string ++ + This format is used when the modem is registered to a network, and there is an active data connection. + +*format-icons*: ++ + typeof: array/object ++ + Based on the current signal strength, the corresponding icon gets selected. ++ + The order is *low* to *high*. Or by the state if it is an object. *tooltip*: ++ typeof: bool ++ @@ -36,8 +69,36 @@ libmm-glib lives in: *tooltip-format*: ++ typeof: strirng ++ - default: Games running: {glyph} ++ - The text format of the tooltip. + default: {state} ++ + The format, how information should be displayed in the tooltip. This format is used when other formats aren't specified. + +*tooltip-format-failed*: ++ + typeof: string ++ + This format is used when the modem cannot start. + +*tooltip-format-locked*: ++ + typeof: string ++ + This format is used when the SIM on the modem is locked. + +*tooltip-format-disabled*: ++ + typeof: string ++ + This format is used when the modem is disabled. + +*tooltip-format-enabled*: ++ + typeof: string ++ + This format is used when the modem is enabled, but isn't registered to any carrier network. + +*tooltip-format-searching*: ++ + typeof: string ++ + This format is used when the modem is looking for a carrier network to register to. + +*tooltip-format-registered*: ++ + typeof: string ++ + This format is used when the modem is registered to a network, but no data connection is active. + +*tooltip-format-connected*: ++ + typeof: string ++ + This format is used when the modem is registered to a network, and there is an active data connection. *interval*: ++ typeof: integer ++ @@ -46,12 +107,10 @@ libmm-glib lives in: *imei*: ++ typeof: string ++ - default: {glyph} ++ Select only the modem with the corresponding imei. *path*: ++ typeof: string ++ - default: {glyph} ++ Select only the modem with the corresponding hardware path. *hide-failed*: ++ @@ -89,11 +148,9 @@ libmm-glib lives in: "format": "{state}", "format-disabled": "", // an empty format will hide the module "format-locked": "SIM Locked", - "format-connected": "{operator_name} {preferred_mode}" + "format-connected": "{operator_name} {preferred_mode} | {signal_quality}%" "tooltip-format": "{mode}", - "tooltip-format-locked": "{satellites_visible} satellites visible", - "tooltip-format-registered": "{satellites_used}/{satellites_visible} satellites used", - "tooltip-format-connected": "", + "tooltip-format-connected": "{current_modes}", "hide-disconnected": false } ``` diff --git a/src/modules/wwan.cpp b/src/modules/wwan.cpp index 7cb8ba8b..5a328a73 100644 --- a/src/modules/wwan.cpp +++ b/src/modules/wwan.cpp @@ -277,7 +277,10 @@ auto waybar::modules::Wwan::update() -> void { store.push_back(fmt::arg("current_modes", getCurrentModesString(current_modem))); store.push_back(fmt::arg("preferred_mode", getPreferredModeString(current_modem))); - store.push_back(fmt::arg("signal_quality", mm_modem_get_signal_quality(current_modem, nullptr))); + int percentage = mm_modem_get_signal_quality(current_modem, nullptr); + store.push_back(fmt::arg("signal_quality", percentage)); + store.push_back(fmt::arg("icon", getIcon(percentage))); + store.push_back(fmt::arg("power_state", getPowerStateString(current_modem))); store.push_back(fmt::arg("imei", mm_modem_dup_equipment_identifier(current_modem)));