LoginSignup
1
1

Ubuntu で Bluetooth 機器の電池残量を設定画面/タスクバーに表示

Posted at

image.png

このようにタスクバーに表示するのに、たまにしか設定せずにすっかり忘れてしまっていたので、改めて備忘録。

環境

  • Ubuntu 22.04 LTS
  • DAISO ブルートゥースイヤホン BT005

タスクバーに表示するためのソフトウェアなど

  • Bluetooth battery indicator 2024/01/16 時点のバージョン
  • Google Chrome バージョン: 120.0.6099.216(Official Build) (64 ビット)
  • Chrome 拡張 GNOME Shell integration バージョン 11 インストール済
  • 拡張機能マネージャ(gnome-shell-extension-prefs)42.9 を Ubuntuディストリビューションパッケージからインストール済

デフォルトだと残量が表示されない

Ubuntu22.04 のデフォルトだとイヤホンの電池残量が取得できず、「設定」-「電源管理」でも表示されていない。
まずはここから直します。

image.png

診断する

$ bluetoothctl info
Device 79:FE:65:03:9C:5E (public)
	Name: DAISO_BT005
	Alias: DAISO_BT005
	Class: 0x00240404
	Icon: audio-headset
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: yes
	WakeAllowed: yes
	LegacyPairing: no
	UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
	UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
	UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb)
	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
	Modalias: bluetooth:v05D6p000Ad0240
	ManufacturerData Key: 0x7262
	ManufacturerData Value:
  32 32 78 78 11 22 33 44 55 66 aa bb 00 00        22xx."3DUf....  

うーん? バッテリ残量が表示されていない?

$ upower -d 
Device: /org/freedesktop/UPower/devices/DisplayDevice
  power supply:         no
  updated:              2024年01月16日 19時18分03秒 (17665 seconds ago)
  has history:          no
  has statistics:       no
  unknown
    warning-level:       none
    percentage:          0%
    icon-name:          ''

Daemon:
  daemon-version:  0.99.17
  on-battery:      no
  lid-is-closed:   no
  lid-is-present:  no
  critical-action: HybridSleep

うーん?

対処法

/etc/bluetooth/main.conf の General セクションに以下のように追記

[General]
Experimental=true

として、bluetooth を再起動

$ sudo service bluetooth restart

してから

$ bluetoothctl info

とすると

Device 79:FE:65:03:9C:5E (public)
	Name: DAISO_BT005
	Alias: DAISO_BT005
	Class: 0x00240404
	Icon: audio-headset
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: yes
	WakeAllowed: yes
	LegacyPairing: no
	UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
	UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
	UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb)
	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
	Modalias: bluetooth:v05D6p000Ad0240
	ManufacturerData Key: 0x7262
	ManufacturerData Value:
  32 32 78 78 11 22 33 44 55 66 aa bb 00 00        22xx."3DUf....  
	Battery Percentage: 0x46 (70)

出たよ出たよ!

電源管理画面でも表示されました。

image.png

なお、最初に作業をしたときには/etc/bluetooth/main.confファイル末に追加して効かないなーと思ったら、ファイル末は[Policy]セクションでした。

タスクバーに表示させる

設定

こちらにアクセスして

「OFF」のスイッチを
image.png

「ON」にして、インストールを進めます。

image.png

その後、拡張機能マネージャを起動して

image.png
「Bluetooth battery indicator」の「設定」

image.png

こんな感じに設定しておきます。

image.png

拡張機能画面に戻って Bluetooth battery indicator をOFF/ONすると
image.png

タスクバーにアイコンが表示されます。
image.png

設定が終わったらここは有効にしていたほうがいいかな。

image.png

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1