From f164aee5c90bc9572adec1a876748680e4d48c05 Mon Sep 17 00:00:00 2001 From: Tobi-wan Kenobi Date: Wed, 9 Nov 2016 19:32:26 +0100 Subject: [PATCH] [modules/brightness] Add missing integer casting for calculation To display a nice percentage-based brightness, round it to int in all circumstances. --- bumblebee/modules/brightness.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bumblebee/modules/brightness.py b/bumblebee/modules/brightness.py index e5d82b8..d91e55c 100644 --- a/bumblebee/modules/brightness.py +++ b/bumblebee/modules/brightness.py @@ -16,7 +16,7 @@ class Module(bumblebee.module.Module): with open("/sys/class/backlight/intel_backlight/max_brightness") as f: self._max = int(f.read()) self._brightness = self._brightness if self._brightness < self._max else self._max - self._percent = round(self._brightness * 100 / self._max) + self._percent = int(round(self._brightness * 100 / self._max)) return bumblebee.output.Widget(self, "{:02d}%".format(self._percent))