mirror of
https://github.com/zoriya/astal.git
synced 2026-05-24 07:00:05 +00:00
1.7 KiB
1.7 KiB
Bluetooth
Library for monitoring bluez over dbus.
Installation
- 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. :::
- clone repo
git clone https://github.com/aylur/astal.git
cd astal/lib/bluetooth
- 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
:::