Commit Graph

10 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
fb6658e8fd chore: lint 2024-01-30 09:07:37 +01:00
eedd1f8e6a Add module systemd-failed-units 2024-01-09 18:19:30 +08:00