From d07835b15cac7d4b3ecccae36f1612894d7136d3 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 11 Jul 2019 16:09:42 +1000 Subject: [PATCH] Fix the battery icon name We need to crop to the nearest 20, not just divide by it. --- tuhigui/drawingperspective.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tuhigui/drawingperspective.py b/tuhigui/drawingperspective.py index 0427951..c34b01f 100644 --- a/tuhigui/drawingperspective.py +++ b/tuhigui/drawingperspective.py @@ -63,7 +63,7 @@ class DrawingPerspective(Gtk.Stack): state = '-charging' else: state = '' - percent = f'{int(device.battery_percent/20):03d}' + percent = f'{int(device.battery_percent/20) * 20:03d}' batt_icon_name = f'battery-{percent}{state}' _, isize = self.image_battery.get_icon_name() self.image_battery.set_from_icon_name(batt_icon_name, isize)