only show what is available

Signed-off-by: Hadi <[email protected]>
This commit is contained in:
Hadi
2026-08-13 18:12:44 +02:00
parent 6e4f8b889c
commit fc35732dbf
8 changed files with 86 additions and 28 deletions
+8
View File
@@ -39,6 +39,14 @@ func CheckAvailable() error {
return nil
}
// Installed reports whether bluetoothctl is present in PATH, without
// probing for a controller. Cheap enough to call when deciding whether to
// show the Bluetooth page in the sidebar.
func Installed() bool {
_, err := exec.LookPath("bluetoothctl")
return err == nil
}
// run executes bluetoothctl in single-command (non-interactive) mode.
// bluetoothctl writes both normal output and error messages to stdout
// (colored with ANSI escapes), so errors are extracted from there rather