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
gproperty available: bool#
  • read-only

Whether there are controllable backlight devices.

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

A list of all backlight devices.

gproperty 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.

async set_brightness_async(value: int) None#

Asynchronously set brightness for all devices.

Parameters:

value (int) -- The value to set.

Return type:

None

gproperty 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.

gproperty device_name: str#
  • read-only

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

gproperty max_brightness: int#
  • read-only

The maximum brightness allowed by the device.

gproperty brightness: int#
  • read-write

The current brightness of the device.

async set_brightness_async(value: int) None#

Asynchronously set brightness.

Parameters:

value (int) -- The value to set.

Return type:

None