Fix backlight

This commit is contained in:
Geoffrey Frogeye 2023-12-16 22:39:11 +01:00
parent a3552634b6
commit a46e7d7bca
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8
8 changed files with 17 additions and 66 deletions

View file

@ -148,6 +148,9 @@ in
"XF86AudioPrev" = "exec ${pkgs.mpc-cli}/bin/mpc prev";
"XF86AudioPlay" = "exec ${pkgs.mpc-cli}/bin/mpc toggle";
"XF86AudioNext" = "exec ${pkgs.mpc-cli}/bin/mpc next";
# Backlight
"XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set +5%";
"XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%-";
# Misc
"${mod}+F10" = "exec ${ pkgs.writeShellScript "show-keyboard-layout"
''
@ -641,6 +644,8 @@ in
home = {
packages = with pkgs; [
pavucontrol # Because can't use Win+F1X on Pinebook 🙃
# remote
tigervnc
@ -677,7 +682,6 @@ in
xclip
keynav
xorg.xinit
xorg.xbacklight
# TODO Make this clean. Service?

View file

@ -47,12 +47,12 @@ in
dconf.enable = false; # Otherwise standalone home-manager complains it can't find /etc/dbus-1/session.conf on Arch.
# Symlinking it to /usr/share/dbus-1/session.conf goes further but not much.
# TODO Use xbacklight instead (pindakaas doesn't seem to support it OOTB)
home.packages = map
(phase: (pkgs.writeShellApplication {
name = "${phase.command}";
runtimeInputs = [ pkgs.brightnessctl ];
text = (lib.optionalString cfg.enable ''
echo ${builtins.toString (builtins.getAttr phase.command cfg)} | sudo tee /sys/class/backlight/${cfg.backlight}/brightness
brightnessctl set ${builtins.getAttr phase.command cfg}
'') + ''
echo ${phase.polarity} > ${polarityFile}
if command -v home-manager