Skip to content

Instantly share code, notes, and snippets.

@guiambros guiambros/up-device.patch
Last active Jun 15, 2019

Embed
What would you like to do?
upower patch
--- up-device.c 2019-06-15 00:18:57.607554731 -0400
+++ up-device-silent.c 2019-06-15 00:19:03.207705276 -0400
@@ -63,6 +63,15 @@
UpDeviceLevel warning_level, battery_level;
UpExportedDevice *skeleton = UP_EXPORTED_DEVICE (device);
+ /* Disable warning notifications for wireless mice with rechargeable batteries */
+ int type = up_exported_device_get_type_ (skeleton);
+ int state = up_exported_device_get_state(skeleton);
+ if (type == UP_DEVICE_KIND_MOUSE && state == UP_DEVICE_STATE_DISCHARGING) {
+ warning_level = UP_DEVICE_LEVEL_NONE;
+ up_exported_device_set_warning_level (skeleton, warning_level);
+ return;
+ }
+
/* Not finished setting up the object? */
if (device->priv->daemon == NULL)
return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.