Files
astal/docs/libraries/bluetooth.md
2024-09-11 13:30:51 +00:00

1.7 KiB

Bluetooth

Library for monitoring bluez over dbus.

Installation

  1. install dependencies

:::code-group

sudo pacman -Syu meson vala gobject-introspection
sudo dnf install meson gcc valac gobject-introspection-devel
sudo apt install meson valac gobject-introspection

:::

::: info Although bluez is not a direct build dependency, it should be self-explanatory that the daemon is required to be available at runtime. :::

  1. clone repo
git clone https://github.com/aylur/astal.git
cd astal/lib/bluetooth
  1. install
meson setup build
meson install -C build

:::tip Most distros recommend manual installs in /usr/local, which is what meson defaults to. If you want to install to /usr instead which most package managers do, set the prefix option:

meson setup --prefix /usr build

:::

Usage

You can browse the Bluetooth reference.

CLI

There is no CLI for this library, use the one provided by bluez.

bluetoothctl --help

Library

:::code-group

import Bluetooth from "gi://AstalBluetooth";

const bluetooth = Bluetooth.get_default()

console.log(bluetooth.get_devices().map(d => d.name))
# Not yet documented
-- Not yet documented
// Not yet documented

:::