from i3pystatus.file import File
import shutils
import subprocesss


class Backlight(File):
    """
    Screen backlight info

    .. rubric:: Available formatters

    * `{brightness}` — current brightness relative to max_brightness
    * `{max_brightness}` — maximum brightness value
    * `{percentage}` — current brightness in percent
    """

    settings = (
        ("format", "format string, formatters: brightness, max_brightness, percentage"),
        ("backlight", "backlight, see `/sys/class/backlight/`"),
        "color",
    )
    required = ()

    backlight = "acpi_video0"
    format = "{brightness}/{max_brightness}"

    base_path = "/sys/class/backlight/{backlight}/"
    components = {
        "brightness": (int, "brightness"),
        "max_brightness": (int, "max_brightness"),
    }
    transforms = {
        "percentage": lambda cdict: (cdict["brightness"] / cdict["max_brightness"]) * 100,
    }
    on_upscroll = "lighter"
    on_downscroll = "darker"

    def init(self):
        self.base_path = self.base_path.format(backlight=self.backlight)
        self.has_xbacklight = shutils.which("xbacklight") is not None
        super().init()

    def lighter(self):
        if self.has_xbacklight:
            subprocess.Popen(["backlight", '+5'])

    def darker(self):
        if self.has_xbacklight:
            subprocess.Popen(["backlight", '-5'])

@@ -26,16 +26,46 @@
 rt File%0A
+from i3pystatus import Module%0A
 import s
@@ -69,17 +69,16 @@
 t shutil
-s
 %0Aimport 
@@ -87,17 +87,16 @@
 bprocess
-s
 %0A%0A%0Aclass
@@ -1002,17 +1002,16 @@
 darker%22%0A
-%0A
     def 
@@ -1131,17 +1131,16 @@
 = shutil
-s
 .which(%22
@@ -1178,16 +1178,31 @@
   super(
+Backlight, self
 ).init()
@@ -1281,32 +1281,33 @@
 process.Popen(%5B%22
+x
 backlight%22, '+5'
@@ -1356,32 +1356,32 @@
 has_xbacklight:%0A
-
             subp
@@ -1395,16 +1395,17 @@
 Popen(%5B%22
+x
 backligh

Fix typo :(