diff --git a/i3pystatus/backlight.py b/i3pystatus/backlight.py index 89e144fb..862b5303 100644 --- a/i3pystatus/backlight.py +++ b/i3pystatus/backlight.py @@ -44,6 +44,8 @@ class Backlight(File): on_downscroll = "darker" def init(self): + self.has_xbacklight = shutil.which("xbacklight") is not None + self.base_path = self.base_path.format(backlight=self.backlight) backlight_entries = sorted(glob.glob(self.base_path)) @@ -53,7 +55,6 @@ def init(self): return self.base_path = backlight_entries[0] - self.has_xbacklight = shutil.which("xbacklight") is not None # xbacklight expects a percentage as parameter. Calculate the percentage # for one step (if smaller xbacklight doesn't increases the brightness) @@ -75,13 +76,9 @@ def run_no_backlight(self): "percentage": -1 } - format = self.format_no_backlight - if not format: - format = self.format - self.data = cdict self.output = { - "full_text": format.format(**cdict), + "full_text": self.format_no_backlight.format(**cdict), "color": self.color }