TUI の Bluetooth マネージャの Bluetuith

Bluetuith という TUI の Bluetooth マネージャーを知ったので試してみました.

bluetuith

terminal で Bluetooth 設定を行う場合,いつもは bluez の bluetoothctl コマンドを使っています.これでそう困っていないのですが, TUI の Bluetuith を知ったので試してみました.
Go製 MIT license です.

導入は go install でさくっと入りました.GitHub の release に Linux版 i386/amd64, armv5/armv6/armv7/arm64 のバイナリがあるのでそちらもお手軽です.

go install での導入
$ go install -v github.com/darkhz/bluetuith@latest
$ which bluetuith
/home/matoken/go/bin/bluetuith
$ bluetuith
GitHub release から armv7版を入手
$ wget https://github.com/darkhz/bluetuith/releases/download/v0.2.3/bluetuith_0.2.3_Linux_armv7.tar.gz \
    https://github.com/darkhz/bluetuith/releases/download/v0.2.3/checksums.txt (1)
$ sha256sum --ignore-missing -c checksums.txt (2)
bluetuith_0.2.3_Linux_armv7.tar.gz: OK
$ tar tvf bluetuith_0.2.3_Linux_armv7.tar.gz (3)
-rw-r--r-- darkhz/darkhz  1064 2024-04-15 22:41 LICENSE
-rwxr-xr-x darkhz/darkhz 8650904 2024-08-12 20:13 bluetuith
$ tar xvf bluetuith_0.2.3_Linux_armv7.tar.gz -C ~/bin/ bluetuith (4)
bluetuith
$ bluetuith
  1. GitHub release から armv7バイナリと checksum を入手

  2. チェックサム確認

  3. archive 確認

  4. バイナリを好みの場所に展開

Bluetuith を起動すると TUI の画面で大まかな操作方法も書かれています. ? key で help を表示するとこんな感じ.

┌──────────────────────────────────────────────────────────┐
│                          Help                         [X]│
│──────────────────────────────────────────────────────────│
│Device Screen                                             │
│Open the menu                                  Alt+m      │
│Navigate between menus                         Tab        │
│Navigate between devices/options               Up/Down    │
│Toggle adapter power state                     o          │
│Toggle discoverable state                      S          │
│Toggle pairable state                          P          │
│Toggle scan (discovery state)                  s          │
│Change adapter                                 a          │
│Send files                                     f          │
│Connect to network                             n          │
│Progress view                                  v          │
│Show/Hide player                               m/M        │
│Show device information                        i          │
│Connect to selected device                     c          │
│Pair with selected device                      p          │
│Trust selected device                          t          │
│Remove device from adapter                     d          │
│Cancel operation                               Ctrl+X     │
│Show help                                      ?          │
│Quit                                           Q          │
│                                                          │
│File Picker                                               │
│Navigate between directory entries             Up/Down    │
│Enter/Go back a directory                      Right/Left │
│Select one file                                Space      │
│Invert file selection                          a          │
│Select all files                               A          │
│Refresh current directory                      Ctrl+R     │
│Toggle hidden files                            h          │
│Confirm file(s) selection                      Ctrl+S     │
│Exit                                           Esc        │
│                                                          │
│Progress View                                             │
│Navigate between transfers                     Up/Down    │
│Suspend transfer                               z          │
│Resume transfer                                g          │
│Cancel transfer                                x          │
│Exit                                           Esc        │
│                                                          │
│Media Player                                              │
│Toggle play/pause                              Up/Down    │
│Next                                           >          │
│Previous                                       <          │
│Rewind                                         Right      │
│Fast forward                                   Left       │
│Stop                                           ]          │
│                                                          │
│Device Screen                                             │
│Open the menu                                  Alt+m      │
│Navigate between menus                         Tab        │
│Navigate between devices/options               Up/Down    │
│Toggle adapter power state                     o          │
│Toggle discoverable state                      S          │
│Toggle pairable state                          P          │
│Toggle scan (discovery state)                  s          │
│Change adapter                                 a          │
│Send files                                     f          │
│Connect to network                             n          │
│Progress view                                  v          │
│Show/Hide player                               m/M        │
│Show device information                        i          │
│Connect to selected device                     c          │
│Pair with selected device                      p          │
│Trust selected device                          t          │
│Remove device from adapter                     d          │
│Cancel operation                               Ctrl+X     │
│Show help                                      ?          │
│Quit                                           Q          │
└──────────────────────────────────────────────────────────┘

alt+m で上部の Anapter のメニューを開くとこんな感じで,

[Adapter] [Device]
┌──────────────────────┐
│Power Off           o │
│Discoverable On     S │
│Pairable Off        P │
│Stop Scan           s │
│Change              a │
│View Downloads      v │
│Hide Media Player   M │
│Quit                Q │
└──────────────────────┘

更にそこから tabDevice を開くとこんな感じです.

[Device]
┌──────────────────────┐
│Connect             c │
│Pair                p │
│Untrust             t │
│Block               b │
│Send                f │
│Network Options     n │
│Audio Profiles      A │
│Show Media Player   m │
│Info                i │
│Remove              d │
└──────────────────────┘

よく使うペアリングは s でスキャンを行い,対象デバイスを選んで p でペアリング.
tTrusted
c で接続,切断.

オーディオデバイスだと A でオーディオプロファイルの選択も出来ます.

┌──────────────────────────────────────────────────┐
│  Off                                             │
│  High Fidelity Playback (A2DP Sink, codec SBC)   │
│  High Fidelity Playback (A2DP Sink, codec SBC-XQ)│
│• Headset Head Unit (HSP/HFP, codec CVSD)         │
│  Headset Head Unit (HSP/HFP, codec mSBC)         │
└──────────────────────────────────────────────────┘

ファイル送受信も出来ます.ファイル受信のときの格納ディレクトリは ~/bluetuith/ の下に置かれます.
但し,ファイル受信は Bluetuith が起動している必要があります.

Bluetuith の終了は Q (shift+q) で終了します.

bluetoothctl より使いやすいのはもちろんですが,Bluetuith の方は scan した後などに MAC アドレスではなく名前で表示されるので複数デバイスの扱いのときにとても便利です.

Rust製の同じような bluetui というものもあるようなのでこちらも試してみたいです.

環境1
$ ls ~/go/pkg/mod/github.com/darkhz/
bluetuith@v0.2.2  tview@v0.0.0-20240308094543-6078a888ff79
$ dpkg-query -W golang bluez bluetooth
bluetooth       5.77-1
bluez   5.77-1
golang:amd64    2:1.22~3
$ lsb_release -dr
Description:    Debian GNU/Linux trixie/sid
Release:        n/a
$ arch
x86_64
環境2
$ bluetuith --version
Bluetuith v0.2.3 (5780d74)
$ dpkg-query -W bluez
bluez   5.66-1+rpt1+deb12u2
$ lsb_release -dr
archNo LSB modules are available.
Description:    Raspbian GNU/Linux 12 (bookworm)
Release:        12
$ arch
armv7l
$ cat /sys/firmware/devicetree/base/model ;echo
Raspberry Pi 3 Model B Rev 1.2

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)