Skip to content

power: Add settings to disable low battery warnings for connected devices

hi,

this is a long requested feature for gnome shell and cinnamon. there are too many posts asking how to disable low battery notifications, and someone even made some scripts that patch and recompile upower for gnome (works for gnome only; cinnamon is too different in this regard).

the problem is that many devices report low battery when they will be able to work fine for a long time, spamming the user with notifications. this happens a lot when users replace alkaline (1.5V nominal) batteries with nickel-based batteries (1.2V nominal). the lower voltage of the rechargeable batteries trigger the warning, but the devices typically work fine with just 1V or less.

this is a quick fix for keyboards and mice, which represent 99+ % of the issue i guess, with a coarse fix for the outliers if any. a different implementation could filter individual devices based on their upower device ID, instead of classes of devices. but i'm not familiar with the dconf system and wouldn't know the best way to implement such "variable schema" on it. (a set of ID strings? who knows.)

i made similar changes for cinnamon (using the same schema but implemented differently):

note that since i don't run gnome shell:

  • i did not test the changes in this merge request!
  • i can't make a UI for it.

but even without the UI, users can at least use dconf editor to fix the issue.

what i did for the cinnamon UI (which has a tendency to hide unused settings to simplify the UI) is:

  • detect whether battery-containing keyboard, mouse, and other devices are present.
  • then:
    • show a toggle for keyboard if keyboard or other is present.
    • show a toggle for mouse if mouse or other is present.
    • show a toggle for other if other is present.

this way, if a toggle for other is needed (strange case) it will be clear and obvious what is NOT included in "other" (ie: keyboard and mouse) because the other options will also be displayed.

thanks!

Merge request reports