mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-12-14 11:23:42 +01:00
brightness script: correctly build sysfs path
This commit is contained in:
parent
c7a67aeb4c
commit
d04f3bb2df
1 changed files with 5 additions and 2 deletions
|
@ -20,9 +20,12 @@
|
|||
(when (sysfs)
|
||||
(for ([dir (directory-list "/sys/class/backlight")])
|
||||
(printf "sysfs: ~a\n" dir)
|
||||
(let* ([max-brightness (string->number (file->string (build-path dir "max_brightness")))]
|
||||
(let* ([max-brightness (string->number
|
||||
(string-trim
|
||||
(file->string
|
||||
(build-path "/sys/class/backlight" dir "max_brightness"))))]
|
||||
[rel-brightness (exact-round (* brightness (/ max-brightness 100)))]
|
||||
[brightness-path (build-path dir "brightness")])
|
||||
[brightness-path (build-path "/sys/class/backlight" dir "brightness")])
|
||||
(display-to-file rel-brightness brightness-path #:exists 'truncate))))
|
||||
|
||||
(match* ((ddc) (find-executable-path "ddcutil"))
|
||||
|
|
Loading…
Reference in a new issue