Slide 1

Slide 1 text

TUI Bluetooth マネージ ャーの bluetuith Kenichiro Matohara(matoken) 1

Slide 2

Slide 2 text

matoken @ 鹿児島の右下の山奥から参加 好きなLinuxディストリビューションは Debian map: © OpenStreetMap contributors Kenichiro Matohara(matoken) https://matoken.org matoken@inari.opencocon.org 2

Slide 3

Slide 3 text

Bluetooth の設定,管理 ウィンドウマネージャ付属(GNOME Bluetooth とか) Blueman bluez 内 bluetoothctrl コマンド 3

Slide 4

Slide 4 text

ヘッドレス環境では bluetoothctrl $ bluetoothctl [bluetooth]# scan on Discovery started [CHG] Controller B8:27:EB:EC:CA:B9 Discovering: yes [NEW] Device E4:26:D5:E1:3A:EE E4-26-D5-E1-3A-EE [CHG] Device E4:26:D5:E1:3A:EE Name: moto g24 : [bluetooth]# pair E4:26:D5:E1:3A:EE Attempting to pair with E4:26:D5:E1:3A:EE [CHG] Device E4:26:D5:E1:3A:EE Connected: yes Request confirmation [agent] Confirm passkey 278296 (yes/no): yes : [bluetooth]# trust E4:26:D5:E1:3A:EE : [bluetooth]# connect E4:26:D5:E1:3A:EE 4

Slide 5

Slide 5 text

次回から 1 ペアリング済のデバイスを確認 2 MAC アドレスを指定して接続 名前では接続できない MAC アドレスで操作するところとか少し面倒 $ bluetoothctl devices Device E4:26:D5:E1:3A:EE moto g24 Device 30:83:D2:65:F6:78 moto g31(w) $ bluetoothctl connect E4:26:D5:E1:3A:EE 1 2 $ bluetoothctl connect "moto g24" Device moto g24 not available 5

Slide 6

Slide 6 text

bluetuith Linux用 TUI Bluetooth マネージャ マウスにも対応 まだアルファ段階 マルチプラットホームもサポート予定(Windows/macOS) Go製,MIT ライセンス https://github.com/darkhz/bluetuith 6

Slide 7

Slide 7 text

導入 パッケージマネージャ source から build GitHub release から binary download Linux版 i386/amd64, armv5/armv6/armv7/arm64 7

Slide 8

Slide 8 text

パッケージ Packaging status Packaging status Alpine Linux 3.19 Alpine Linux 3.19 0.1.9 0.1.9 Alpine Linux 3.20 Alpine Linux 3.20 0.2.3 0.2.3 Alpine Linux Edge Alpine Linux Edge 0.2.3 0.2.3 AUR AUR 0.2.3 0.2.3 Chimera Linux Chimera Linux 0.2.3 0.2.3 Gentoo overlay GURU Gentoo overlay GURU 0.2.2 0.2.2 LiGurOS stable LiGurOS stable 0.2.1 0.2.1 LiGurOS develop LiGurOS develop 0.2.2 0.2.2 nixpkgs stable 22.11 nixpkgs stable 22.11 0.1.3 0.1.3 nixpkgs stable 23.05 nixpkgs stable 23.05 0.1.3 0.1.3 nixpkgs stable 23.11 nixpkgs stable 23.11 0.1.9 0.1.9 nixpkgs stable 24.05 nixpkgs stable 24.05 0.2.2 0.2.2 nixpkgs unstable nixpkgs unstable 0.2.3 0.2.3 openSUSE Leap 15.5 openSUSE Leap 15.5 0.1.7 0.1.7 openSUSE Leap 15.6 openSUSE Leap 15.6 0.1.7 0.1.7 openSUSE Tumbleweed openSUSE Tumbleweed 0.2.3 0.2.3 Void Linux x86_64 Void Linux x86_64 0.2.3 0.2.3 8

Slide 9

Slide 9 text

go install $ go install -v github.com/darkhz/bluetuith@latest $ which bluetuith /home/matoken/go/bin/bluetuith $ bluetuith 9

Slide 10

Slide 10 text

GitHub release から ダウンロード から 最新の自分の環境にあったものを入手 ここではarmv7版を入手 1 GitHub release から armv7バイナリと checksum を入手 2 チェックサム確認 3 バイナリを好みの場所に展開 https://github.com/darkhz/bluetuith/releases/latest $ wget https://github.com/darkhz/bluetuith/releases/download/v0.2.3/bluetuith_0.2.3_Linux_armv7 https://github.com/darkhz/bluetuith/releases/download/v0.2.3/checksums.txt $ sha256sum --ignore-missing -c checksums.txt bluetuith_0.2.3_Linux_armv7.tar.gz: OK $ tar tvf bluetuith_0.2.3_Linux_armv7.tar.gz -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 bluetuith $ bluetuith 1 2 3 10

Slide 11

Slide 11 text

メイン画面 左上: メニュー 右上: ステータス 中央: デバイス 下部: 簡易ヘルプ 11

Slide 12

Slide 12 text

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 │ 12

Slide 13

Slide 13 text

│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 │ 13

Slide 14

Slide 14 text

│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 ] │ 14

Slide 15

Slide 15 text

│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 │ └──────────────────────────────────────────────────────────┘ 15

Slide 16

Slide 16 text

Anapter のメニュー(alt+m) [Adapter] ┌──────────────────────┐ │Power Off o │ │Discoverable On S │ │Pairable Off P │ │Stop Scan s │ │Change a │ │View Downloads v │ │Hide Media Player M │ │Quit Q │ └──────────────────────┘ 16

Slide 17

Slide 17 text

Device のメニュー(alt+m tab) [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 │ └──────────────────────┘ 17

Slide 18

Slide 18 text

ペアリング操作例 s でスキャン開始 対象デバイスを選んで p でペアリング t で Trusted c で接続,切断 ┌─────────────────────────────────────────────────────────────────┐ │ Passkey Confirmation [X]│ │─────────────────────────────────────────────────────────────────│ │ Confirm passkey for moto g24 is │ │ │ │ 438777 │ │ │ │Press y/n to Confirm/Cancel, click the required button or click │ │ the X button to close this dialog. │ │ │ │ [Confirm] [Cancel] │ └─────────────────────────────────────────────────────────────────┘ 18

Slide 19

Slide 19 text

オーディオプロファイル選択(A) いつもは pactl コマンドを叩いていたので便利 ┌──────────────────────────────────────────────────┐ │ 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) │ └──────────────────────────────────────────────────┘ 19

Slide 20

Slide 20 text

ネットワーク接続(n) ┌───────────────────────────────────────┐ │Personal Area Network (PANU) │ └───────────────────────────────────────┘ 20

Slide 21

Slide 21 text

ファイル転送(f)  受信ファイルは ~/bluetuith/ 以下に格納 Select files to send Directory: /home/matoken/Pictures Screenshot from 2022-11-12 00-53-33.png ---------- 55.7 kB 12 Nov 2022 12:53 AM Screenshot from 2022-11-12 11-23-46.png ---------- 476.6 kB 12 Nov 2022 11:24 AM Screenshot from 2022-11-12 11-24-29.png ---------- 231.0 kB 12 Nov 2022 11:24 AM Screenshot from 2022-11-12 11-25-12.png ---------- 276.9 kB 12 Nov 2022 11:25 AM Screenshot from 2022-11-12 11-26-54.png ---------- 182.0 kB 12 Nov 2022 11:26 AM Screenshot from 2022-11-12 11-28-24.png ---------- 174.0 kB 12 Nov 2022 11:28 AM Screenshot from 2022-11-12 11-32-06.png ---------- 14.5 kB 12 Nov 2022 11:32 AM Screenshot from 2022-11-15 17-53-55.png ---------- 179.4 kB 15 Nov 2022 05:54 PM Screenshot from 2022-11-25 20-55-14.png ---------- 31.0 kB 25 Nov 2022 08:55 PM Screenshot from 2022-11-25 20-56-02.png ---------- 17.8 kB 25 Nov 2022 08:56 PM Screenshot from 2022-11-25 20-56-53.png ---------- 32.4 kB 25 Nov 2022 08:56 PM Screenshot from 2022-11-29 19-09-23.png ---------- 197.7 kB 29 Nov 2022 07:09 PM [OK] [Cancel] [Toggle hidden] [Invert selection] [Select All] 21

Slide 22

Slide 22 text

まとめ TUI でお手軽に利用できる blutuish マウスにも対応 ペアリング時にも名前が出てきてわかりやすい まだアルファだが特に困らず利用できている ヘッドレス環境で Bluetooth を扱う際はおすすめ 22

Slide 23

Slide 23 text

SEE ALSO Rust製,GPLv3 の類似のもの(未検証) pythops/bluetui: 🛜 TUI for managing bluetooth on Linux. https://github.com/pythops/bluetui 23

Slide 24

Slide 24 text

奥付 発表 2024-08- 25(sun) 発表者 利用ソフトウェア + ライセンス 第4回 Fediverse Linux User Group 勉強会 Kenichiro Matohara(matoken) Neovim Asciidoctor Reveal.js CC BY 4.0 24