Delgan / yambar-bluetooth

A Bluetooth module for Yambar status panel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yambar-bluetooth

A Bluetooth module for Yambar status panel.

Installation

First build the software:

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
make

Then install it:

sudo make install

Usage

The yambar-bluetooth program will observe connections to a Bluetooth adapter.

It produces the following tags that can be used by Yambar:

Name Type Description
powered bool Whether the adapter is powered on
discovering bool Whether the adapter is in discovering mode
connected bool Whether the observed device is connected
count int Total number of connected devices (including the observed one)
address string The MAC address of the observed device (empty if none was found)
name string The name of the observed device (empty if none was found)
icon string The icon of the observed device (empty if none was found)

Configuration

The yambar-bluetooth command accepts two optional arguments:

Option Type Description
--adapter-name <name> string The name of the Bluetooth adapter that will be observed. By default, "hci0" is used.
--device-address <address> string The MAC address of a specific device to observe. By default, the first device found to be connected will be observed.

See also yambar-bluetooth --help.

Example

Here is a possible config.yaml for Yambar:

bar:
  height: 32
  location: bottom
  background: 111111cc

  left:
    - script:
        path: /usr/bin/yambar-bluetooth
        content:
          map:
            conditions:
              connected:
                string:
                  text: "[Bluetooth ON] {name} ({address})"
              ~connected:
                string:
                  text: "[Bluetooth OFF] No device"

About

A Bluetooth module for Yambar status panel

License:MIT License


Languages

Language:C 98.4%Language:CMake 1.6%