Backlight#

class ignis.services.backlight.BacklightService(*args: Any, **kwargs: Any)#

A backlight service. Allows controlling device screen brightness.

Example Usage:

from ignis.services.backlight import BacklightService

backlight = BacklightService.get_default()

print(backlight.brightness)
print(backlight.max_brightness)
print(backlight.available)

backlight.set_brightness(30) # set brightness to 30 on all devices

# backlight.devices[1].set_brightness(50) # set brightness to 50 on the second device in the list
property available: bool#
  • read-only

Whether there are controllable backlight devices.

property devices: list[BacklightDevice]#
  • read-only

A list of all backlight devices.

property brightness: int#
  • read-write

The current brightness of the first backlight device in the list, -1 if there are no backlight devices. Setting this property will set provided brightness on ALL backlight devices.

property max_brightness: int#
  • read-only

The maximum brightness allowed by the first backlight device in the list, -1 if there are no backlight devices.

class ignis.services.backlight.BacklightDevice(device_name: str)#

A backlight device.

property device_name: str#
  • read-only

The name of the directory in /sys/class/backlight.

property max_brightness: int#
  • read-only

The maximum brightness allowed by the device.

property brightness: int#
  • read-write

The current brightness of the device.