ecmenu/menu.led.scm

20 lines
716 B
Scheme
Raw Normal View History

2024-10-10 13:49:40 +00:00
(module (menu led)
(enable-led
disable-led)
(import (scheme)
(chicken base)
(chicken process))
;; Investigate: there are the kernel modules ledtrig_timer and ledtrig_heartbeat.
;; The latter, when `echo heartbeat` to `trigger`, does what one would expect.
(define (enable-led colour)
(process-run (string-append "echo 255 | sudo tee /sys/class/leds/"
(symbol->string colour)
"_led/brightness")))
(define (disable-led colour)
(process-run (string-append "echo 0 | sudo tee /sys/class/leds/"
(symbol->string colour)
"_led/brightness"))))