summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Wilken2023-07-04 18:49:48 +0200
committerTimo Wilken2023-07-04 18:49:48 +0200
commitc27c7d5386b179c81192b4dc12e934976ed6ca7d (patch)
treec6c01f519f2135a99d03c1db7281eca567e99e97
parent5912e1a45d5cdd42632c441dc742588f2c3462c3 (diff)
Manually set backlight through /sys
This should avoid xbacklight's XRandR errors on boot.
-rw-r--r--tw/system/lap.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/tw/system/lap.scm b/tw/system/lap.scm
index f17777ee..eb4b7006 100644
--- a/tw/system/lap.scm
+++ b/tw/system/lap.scm
@@ -375,7 +375,15 @@ support extra features (acr, pmu, gr).")
(provision '(backlight))
(one-shot? #t)
(start #~(make-forkexec-constructor
- (list #$(file-append xbacklight "/bin/xbacklight") "-set" "100"))))))
+ (list #$(program-file "backlight-setter"
+ #~(begin
+ (use-modules ((ice-9 textual-ports) #:select (get-string-all))
+ ((srfi srfi-26) #:select (cut)))
+ (define max-brightness
+ (call-with-input-file "/sys/class/backlight/intel_backlight/max_brightness"
+ get-string-all))
+ (call-with-output-file "/sys/class/backlight/intel_backlight/brightness"
+ (cut display max-brightness <>))))))))))
(extra-special-file "/etc/guix/machines.scm"
(scheme-file "machines.scm"