Commit Graph
22 Commits
Author SHA1 Message Date
Alex fc6a567974 fix(systemd-failed-units): guard label/tooltip format against bad config
A malformed user format or tooltip-format (unknown {placeholder}) made
fmt::format throw fmt::format_error out of update(). Wrap the label and
tooltip format calls in try/catch that warn once and fall back to a safe
label / skip the tooltip instead of taking the module down.
2026-07-05 10:13:24 +02:00
Alex 836449d253 refactor(modules): use ALabel dedup tooltip helper in simpleclock, systemd-failed-units, upower
simpleclock: migrate to updateLabelAndTooltip (label + tooltip share the
localtime arg; default tooltip falls back to the label format).
systemd-failed-units: use setLabelMarkup/setTooltipMarkup dedup setters;
label/tooltip formats are selected by different conditions so the combined
helper does not apply.
upower: use setLabelMarkup for the label; tooltip stays a custom GTK widget.
mpd already uses the dedup setters (label/tooltip use different truncated
args), so no change.
2026-07-04 00:00:17 +02:00
Alexis Rouillard d618b4125d Merge branch 'master' into fix-tooltip-pango 2026-07-03 22:21:57 +02:00
Alex f739cb7f75 Merge remote-tracking branch 'origin/master' into stkth/fix-4241
# Conflicts:
#	src/modules/systemd_failed_units.cpp
2026-07-03 21:05:32 +02:00
Agnibha Mukherjee 3229c2c9fc feat: support Pango markup in remaining tooltips 2026-05-14 11:01:58 +05:30
Carlo Teubner e7c077ab9a clang-format 2026-03-17 21:39:55 +00:00
Carlo Teubner 3b1262061d systemd-failed-units: tooltip w/ failed units list 2026-03-17 21:35:20 +00:00
Carlo Teubner d046c19b85 systemd-failed-units: small tweaks
- Remove unneeded destructor impl
- Rename member variables for consistench with other files
- manpage wording fixes
- updateData(): small logic tweak
2026-03-17 21:34:59 +00:00
Alex 7744320ab2 fix: build 2026-02-24 00:55:27 +01:00
Alex ef3d55980e fix: some crashes 2026-02-24 00:49:08 +01:00
Steffen Kothe 3060141a65 fix: Fix hide_on_ok when user or system session is ignored
In case of an user ignoring the failed system or user units, hiding of
the waybar module did not work.

Ensure that the ignore case of a system or user bus is reflected
correctly by determining the configuration.

Fixes [1] where regression was introduced in [2].

Links:
[1] https://github.com/Alexays/Waybar/issues/4241
[2] https://github.com/Alexays/Waybar/issues/4240

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-08-15 10:58:27 +00:00
Steffen Kothe 4a7da0cab2 fix: Fail early when neither user nor system is requested
The module can be configured to neither request the user nor the system
session.

In fact does this display non-valuable information to the user and can
be considered as abuse case of the configuration.

Therefore throw an exception when neither user nor system session are
requested.

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-08-15 10:55:25 +00:00
Steffen Kothe cfb47790ad modules: systemd_failed_units: Introduce systemd state variables
Systemd provides the status of a given user and system session as a
human readable string.

Retrieve this information via RequestSystemState and guard the
retrieve of failed units depending on this request.

The functionality is extended but does not change, which means that
failed units in any granularity are displayed as before.

Update documentation in the meantime.

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-21 16:53:12 +00:00
Steffen Kothe d5e3a9f894 modules: systemd_failed_units: Enforce visibility of event box on every update
Instead if guarding visibility in if condition, enforce visibility
regardless of the state of the current update.

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-21 16:51:13 +00:00
Steffen Kothe 0731117679 modules: systemd_failed_units: Introduce RequestFailedUnits member
Split-out request of failed units from systemd into a separate member
function.

This increases the readability and extendability, but preserves the
current functionality (non-functional change).

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-21 16:51:13 +00:00
Steffen Kothe 4bb06b86bc modules: systemd_failed_units: Use explicit g_variant_get_uint32
Determining of failed units can be done by usage of explicit uint32
function with direct return due to auto lambda expression.

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-21 16:47:27 +00:00
Steffen Kothe 74255d0c7e modules: systemd_failed_units: Move DBUS proxy check into lambda function
Checking for the availability of a given proxy member can be done in the
lambda function as well.

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-21 16:47:25 +00:00
Steffen Kothe 5c2cf4c65c modules: systemd_failed_units: Fail early if state did not change
Prefer early exit if last status matches the current status.

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-21 16:47:07 +00:00
Steffen Kothe dcbbe3bb97 modules: systemd_failed_units: Move nr_failed calculation to updateData
Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-21 16:46:06 +00:00
Steffen Kothe 37a6106d3e modules: systemd_failed_units: Introduce nr_failed as member
Keeping nr_failed as member allows to split-out calculation of overall
failed units into updateData.

Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
2025-06-21 15:17:59 +00:00
Alex fb6658e8fd chore: lint 2024-01-30 09:07:37 +01:00
oxalica eedd1f8e6a Add module systemd-failed-units 2024-01-09 18:19:30 +08:00