diff --git a/core/cmd/dms/commands_doctor.go b/core/cmd/dms/commands_doctor.go index 491cd2ab..13e96a28 100644 --- a/core/cmd/dms/commands_doctor.go +++ b/core/cmd/dms/commands_doctor.go @@ -689,6 +689,19 @@ func checkOptionalDependencies() []checkResult { logindStatus, logindMsg := getOptionalDBusStatus("org.freedesktop.login1") results = append(results, checkResult{catOptionalFeatures, "logind", logindStatus, logindMsg, "Session management", optionalFeaturesURL}) + cupsPkHelperBus := "org.opensuse.CupsPkHelper.Mechanism" + var cupsPkStatus status + var cupsPkMsg string + switch { + case utils.IsDBusServiceAvailable(cupsPkHelperBus): + cupsPkStatus, cupsPkMsg = statusOK, "Running" + case utils.IsDBusServiceActivatable(cupsPkHelperBus): + cupsPkStatus, cupsPkMsg = statusOK, "Available" + default: + cupsPkStatus, cupsPkMsg = statusWarn, "Not available (install cups-pk-helper)" + } + results = append(results, checkResult{catOptionalFeatures, "cups-pk-helper", cupsPkStatus, cupsPkMsg, "Printer management", optionalFeaturesURL}) + results = append(results, checkI2CAvailability()) terminals := []string{"ghostty", "kitty", "alacritty", "foot", "wezterm"} diff --git a/core/internal/utils/dbus.go b/core/internal/utils/dbus.go index 3f65aae2..bafd51fc 100644 --- a/core/internal/utils/dbus.go +++ b/core/internal/utils/dbus.go @@ -1,6 +1,8 @@ package utils import ( + "slices" + "github.com/godbus/dbus/v5" ) @@ -18,3 +20,18 @@ func IsDBusServiceAvailable(busName string) bool { } return owned } + +func IsDBusServiceActivatable(busName string) bool { + conn, err := dbus.ConnectSystemBus() + if err != nil { + return false + } + defer conn.Close() + + obj := conn.Object("org.freedesktop.DBus", "/org/freedesktop/DBus") + var activatable []string + if err := obj.Call("org.freedesktop.DBus.ListActivatableNames", 0).Store(&activatable); err != nil { + return false + } + return slices.Contains(activatable, busName) +}