Skip to content

Droptop-Four/Rainmeter-Bluetooth-Plugin

Repository files navigation

Bluetooth Plugin for Rainmeter

This plugin is still a WIP (Work In Progress) and it doesn't include all the features that could be useful to have. If you want to see planned features, please check the Features section. If you want to help, please check the Contributing section.

Installation

Download the latest example rmskin from the releases page and install it: the plugin will be in the package.

Else, you can download the zip package from the latest release and extract the dll that corresponds to the Windows architecture you are using (x32 or x64) to %appdata%\Rainmeter\Plugins.

Requirements

  • Windows 10

Documentation

Head over to https://droptop.gitbook.io/rainmeter-bluetooth-plugin to read the full documentation.

Basic Usage

NOTE: Since this plugin is still a WIP, the usage is subject to change.

The plugin at every update, is going to scan for Bluetooth devices, and update the list of available devices. The plugin is going to store the list of devices in a formatted string, that can be accessed using the AvailableDevices() function.

The formatted string is going to be in the following format:

device_name|device_address|device_id|connected[0,1]|paired[0,1]|can_pair[0,1]major_category|minor_category|has_battery_level[0,1]|battery|is_ble[0,1];

This is an example of how you can use the plugin in a skin:

[Bluetooth]
Measure=Plugin
Plugin=Bluetooth
DevicesUpdatedAction=[!CommandMeasure LuaScript "Refresh()"]
UpdateDivider=30    ; Keep a relatively high value, to avoid spamming the plugin with update requests that cannot terminate

[LuaScript]
Measure=Script
ScriptFile=Example.lua
UpdateDivider=-1
function Refresh()
    local DevicesString = SKIN:ReplaceVariables('[&BluetoothMeasure:AvailableDevices()]')
    -- DevicesString = Formatted string of all devices
    -- ("device_name|device_address|device_id|connected[0,1]|paired[0,1]|can_pair[0,1]major_category|minor_category|has_battery_level[0,1]|battery|is_ble[0,1];")

    -- Do something with the devices list
    -- See example skin for an example
end

For a complete example, check out the example skin.

Features

Those are the features we'd like to implement/have in a bluetooth plugin:

  • Enable/Disable/Toggle Bluetooth adapter
  • List Bluetooth devices
  • Discover Bluetooth devices
  • Return the Bluetooth status
  • List BluetoothLE devices
  • Discover BluetoothLE devices
  • Connect to devices
  • Disconnect devices
  • Pair devices
  • Unpair devices
  • Get device thumbnail

Device Properties

Those are the returned properties for every device:

  • Name
  • Address
  • Id
  • Connected
  • Paired
  • Can Pair
  • Major Category
  • Minor Category
  • Has Battery Level
  • Battery
  • Is Bluetooth LE
  • Signal strength

To know more about those properties, read the docs.

Contributing

If you want to help you are encouraged to fork the repo and do your changes, then open a pull request! Any help is appreciated!

If you want to suggest a feature or report a bug, please open an issue!

License

This project is licensed under the GPL-3.0 License - see the LICENSE file for details.