Cap.ok: def of ezx@1.11.0.0 Import: import ezx@1.11.0.0/src/share/cap.bend as Cap Lines 26-34 of ezx@1.11.0.0/src/share/cap.bend: https://jend.leeeet.dev/read.txt?path=ezx@1.11.0.0/src/share/cap.bend&start_line=26&end_line=34 import Base import snap@1.4.0.0/main.bend as R # whether a `bend` can be capped. The cap is `systemd-run --user`. That # fails when the program is absent, and it fails when the program is present # and the user bus is not. Either failure is no cap. A probe that would # wait on a password fails closed instead. def ok() -> IO(Bool): do IO: +out : String <- R.exec(["systemd-run", "--user", "--scope", "-q", "--collect", "--no-ask-password", "true"]) return R.ok(out) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=snap@1.4.0.0/main.bend&name=exec https://jend.leeeet.dev/definition.txt?path=snap@1.4.0.0/main.bend&name=ok