def ok
import ezx@1.11.0.0/src/share/cap.bend as Capimport Base
import snap@1.4.0.0/main.bend as R
26# whether a `bend` can be capped. The cap is `systemd-run --user`. That
27# fails when the program is absent, and it fails when the program is present
28# and the user bus is not. Either failure is no cap. A probe that would
29# wait on a password fails closed instead.
30def ok() -> IO(Bool):
31 do IO<Bool>:
32 +out : String <- R.exec(["systemd-run", "--user", "--scope", "-q",
33 "--collect", "--no-ask-password", "true"])
34 return R.ok(out)