zmk icon indicating copy to clipboard operation
zmk copied to clipboard

Getting constant battery indicator notifications on Linux.

Open Ay1tsMe opened this issue 1 year ago • 7 comments

I keep getting battery level notifications every few minutes on Linux when I don't use the keyboard after a while.

I'm not sure if there is a config option that turns off notifications for the keyboard. I'm pretty sure what's happening is it's sending a notification of the battery when the keyboard wakes up from sleeping. It would be nice if I could turn this off but still get a notification when it connects from a disconnect with the battery level as well.

Ay1tsMe avatar May 04 '24 09:05 Ay1tsMe

You can turn off battery level monitoring with CONFIG_BT_BAS=n in your _defconfig or .conf file

ReFil avatar May 04 '24 09:05 ReFil

You can turn off battery level monitoring with CONFIG_BT_BAS=n in your _defconfig or .conf file

Will this turn off all monitoring of my battery or just the notifications? Because I want the notification to still appear but only when it connects to my PC from a disconnect

Ay1tsMe avatar May 04 '24 11:05 Ay1tsMe

With that disabled, you will not be able to see the battery level at all.

This sounds like an issue with the OS more than the keyboard. Could you provide more information about your setup? "Linux" doesn't tell us much...

joelspadin avatar May 04 '24 15:05 joelspadin

Using hyprland on EndevourOS. Im using mako to handle notifications.

I dont have an issue with any of my other Bluetooth devices renotifying me about the battery level. I have a mx master 3s and it doesnt ping the battery.

Ive also noticed its not very consistent behaviour. For example it might notify me mid typing so im not 100 percent sure if its a wakeup notification problem or if its just randomly sending them out.

Ay1tsMe avatar May 05 '24 13:05 Ay1tsMe

I am experiencing the same, although I never figured out it was triggered by a sleep/wake event. NiceNano + Arch Hyprland here, with blueman and swaync. I also use the reporting feature to monitor battery levels at all times in Waybar. Never had any issues with other devices either.

JeffDess avatar May 07 '24 02:05 JeffDess

I use dunst on Hyprland on NixOS and this worked for me:

Edit: .config/dunst/dunstrc:

[ignore_kb_bat_notifications]
   appname = "blueman"
   summary = "Skree Custom"
   body = "Connected *%"
   skip_display = true

You can check your notification summary, appname, and other data (likely the message is different for other languages) with dunstctl history.

I think this will specifically help you @JeffDess

igorgue avatar Aug 01 '24 15:08 igorgue

Thanks @igorgue, that's neat. I believe there is a similar functionality in swaync:

"notification-visibility": {
  "Bluetooth":{
    "app-name": "blueman",
    "state": "ignored",
  }
},

However, I am using Sway most of the time these days (Hyprland is way too buggy since this wlroots thing) and I cannot say I have experienced the issue for a while.

Since everybody who commented here is using Hyprland and the timeframe also matches perfectly with the wlroots work, I'd say there's a good chance that it was introduced by this new implementation (April~May).

JeffDess avatar Aug 01 '24 17:08 JeffDess