Bugs and Debugging
Encountering issues with this extension? Please follow the steps below for troubleshooting and reporting:
Battery Level Not Displaying for Bluetooth Device
- Verify Display in Gnome Control Center: Check if the battery level is visible in Gnome Control Center (Settings) > Power tab.
- Enable Bluez Experimental Feature: If not displayed, your Bluetooth device might require the Bluez experimental feature for battery reporting. Enable Bluez experimental feature and recheck in Gnome Control Center.
- Check Device Compatibility: If the battery level still does not show, test the device with other OS/devices (e.g., iOS/Android). Consult the OEM website/documentation to confirm if your Bluetooth device supports battery level reporting.
- Issue with Bluez: If the device supports battery reporting but it’s not visible in Gnome Control Center, conduct further tests and consider raising an issue on the Bluez website.
- Extension-Specific Issue: If the battery level appears correctly in Gnome Control Center but not in this extension, please Raise an issue on GitHub.
Gnome Control Center 
Battery Level Inaccuracies or Stuck Readings
- Understanding Battery Reporting Increments:
- Bluetooth devices vary in how they report battery levels. Expectations of a continuous decrease (e.g., 100%, 99%, 98%…) might not align with the device’s design.
- Devices may report in increments of 5% (100%, 95%, 90%…), 10% (100%, 90%, 80%…), or even 20% (100%, 80%, 60%…).
- Observing Quick Settings Percentage:
- When enabled, the Quick Settings percentage display might show the battery level being “stuck” at a certain percentage (e.g., 100%) and then suddenly drop (e.g., to 80%) if the device reports in larger increments.
- Consistency Check:
- Verify if the battery level displayed in Gnome Control Center (Settings) > Power is consistent with what is shown in this extension. If there is a discrepancy, please Raise an issue on GitHub.
GUI issue
- Check if there are any other Bluetooth Gnome extension installed and enabled that might conflict with this extension.
- Reset the
gsettingsfor this extension. First, disable the extension using theExtensionsorExtension Managerapp. To resetgsettingsfor the Bluetooth Battery Meter extension, use the command below in theterminal:gsettings --schemadir /home/$USER/.local/share/gnome-shell/extensions/Bluetooth-Battery-Meter@maniacx.github.com/schemas reset-recursively org.gnome.shell.extensions.Bluetooth-Battery-Meter - If the issue still persists, Raise an issue on Github.
- When reporting the issue, include the following details:
- Gnome Version (found in the
aboutsection of your desktop settings (Gnome Control Center)) - Operating system (e.g., Ubuntu 23.10)
- Bluetooth device make, model and type
- Gnome Version (found in the
Although this extension does not include built-in logs, you can still monitor errors and activity using system logs and its own log file.
Gnome Shell Logs (Extension Runtime)
View logs related to the extension running in GNOME Shell:
journalctl -f -o cat /usr/bin/gnome-shell
Enhanced Device Socket Handler Logs
Low-level device socket activity is logged separately:
tail -f /tmp/bluetooth_battery_meter/service.log
For detailed packet-level debugging, edit:
~/.local/share/gnome-shell/extensions/Bluetooth-Battery-Meter@maniacx.github.com/lib/devices/logger.js
Set these flags to true:
const LOG_INFO = true;
const LOG_BYTES = true;
This enables verbose socket logging including raw bytes. Logout and Relogin and monitor using tail -f
GJS Logs (Extension Preferences)
Monitor logs related to extension preferences:
journalctl -f -o cat /usr/bin/gjs
Command Line Tips
#List UUID of all extensions installed
gnome-extensions list
#Enable extension using UUID
gnome-extensions enable Bluetooth-Battery-Meter@maniacx.github.com
# Open extension prefs using UUID
gnome-extensions prefs Bluetooth-Battery-Meter@maniacx.github.com
#Disable extension using UUID
gnome-extensions disable Bluetooth-Battery-Meter@maniacx.github.com
#Disable all extensions
gsettings set org.gnome.shell disable-user-extensions true
#Enable all extensions
gsettings set org.gnome.shell disable-user-extensions false
# Kill gnome-shell
killall -3 gnome-shell
# Force shutdown
sudo reboot -f
This can be helpful if gnome shell freezes (GUI stops). You can always move to terminal session using keys CTRL+ALT+F3, login, disable extension (if you know extension causing the problem) or disable all extension, kill gnome shell. Use CTRL+ALT+F1 to login to display session.