regolith-linux / regolith-i3xrocks-config

Regolith customization of i3xrocks.
Other
29 stars 49 forks source link

Try to use bluetooth device alias instead of name #142

Closed jeffothy closed 2 years ago

jeffothy commented 2 years ago

When an alias for a bluetooth device has been set (for example, with bluetoothctl set-alias ...), we can use it instead of the device's full name.

There are no tests for the bluetooth script yet. This is a very small touch, so no tests have been added here either.

kgilmer commented 2 years ago

Hi @jeffothy , thanks for your contribution! How can I test your feature locally? I don't have a bluetooth command. Can you give more details?

jeffothy commented 2 years ago

Hi @kgilmer , whoops that should have been bluetoothctl, I'll correct the PR description.

jeffothy commented 2 years ago

Here's a more explicit example of how I tested manually:

$ /usr/share/i3xrocks/scripts/bluetooth
<span color="#F6F5F4" font_desc="BitstreamVeraSansMono Nerd Font 12">  </span><span color="#B8B8B8" font_desc="BitstreamVeraSansMono Nerd Font 12">WH-XB900N </span>
$ bluetoothctl set-alias JCans
[CHG] Device 14:3F:A6:46:50:3F Alias: JCans
Changing JCans succeeded
$ /usr/share/i3xrocks/scripts/bluetooth
<span color="#F6F5F4" font_desc="BitstreamVeraSansMono Nerd Font 12">  </span><span color="#B8B8B8" font_desc="BitstreamVeraSansMono Nerd Font 12">JCans </span>
$ 
kgilmer commented 2 years ago

Thanks for the testing details, LGTM!