add code to consider brightnessctl binary for brightness module

This commit is contained in:
Frank Scherrer 2019-06-14 12:04:36 +02:00
parent ed25538bcb
commit 7398bf9f94
No known key found for this signature in database
GPG key ID: 6BFD1DE5E5AEDC50

View file

@ -28,6 +28,11 @@ class Module(bumblebee.engine.Module):
cmd="light -A {}%".format(step)) cmd="light -A {}%".format(step))
engine.input.register_callback(self, button=bumblebee.input.WHEEL_DOWN, engine.input.register_callback(self, button=bumblebee.input.WHEEL_DOWN,
cmd="light -U {}%".format(step)) cmd="light -U {}%".format(step))
elif bumblebee.util.which("brightnessctl"):
engine.input.register_callback(self, button=bumblebee.input.WHEEL_UP,
cmd="brightnessctl s {}%+".format(step))
engine.input.register_callback(self, button=bumblebee.input.WHEEL_DOWN,
cmd="brightnessctl s {}%-".format(step))
else: else:
engine.input.register_callback(self, button=bumblebee.input.WHEEL_UP, engine.input.register_callback(self, button=bumblebee.input.WHEEL_UP,
cmd="xbacklight +{}%".format(step)) cmd="xbacklight +{}%".format(step))