- (defparameter *backlight-root* #P"/sys/class/backlight/")
-
- (defclass backlight-device ()
- ((device-name :accessor backlight-device-name
- :initarg :device-name)
- (max-brightness :type (integer 0)
- :attribute "max_brightness"
- :parser parse-integer
- :reader backlight-max-brightness
- :constp t)
- (brightness :type (integer 0)
- :parser parse-integer
- :attribute "brightness"
- :accessor backlight-brightness))
- (:metaclass sysfs-class))
-
- (defun make-backlight-device-from-pathname (pathname)
- (make-instance 'backlight-device
- :sysfs-base-directory pathname
- :device-name (lastcar (pathname-directory pathname))))
-
- (defun backlight-devices ()
- (mapcar #'make-backlight-device-from-pathname
- (uiop:subdirectories *backlight-root*)))