1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-12 08:42:13 -04:00

doctor: add cups-pk-helper

This commit is contained in:
bbedward
2026-02-14 10:38:03 -05:00
parent 124106de87
commit 14f92669c6
2 changed files with 30 additions and 0 deletions

View File

@@ -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)
}