diff --git a/home/profiles/io/default.nix b/home/profiles/io/default.nix index 50acdcf9..de38dbba 100644 --- a/home/profiles/io/default.nix +++ b/home/profiles/io/default.nix @@ -29,6 +29,7 @@ ../../services/wayland/gammastep.nix ../../services/wayland/hyprpaper.nix ../../services/wayland/hypridle.nix + ../../services/wayland/wluma.nix # terminal emulators ../../terminal/emulators/foot.nix diff --git a/home/services/wayland/wluma.nix b/home/services/wayland/wluma.nix new file mode 100644 index 00000000..0749c1db --- /dev/null +++ b/home/services/wayland/wluma.nix @@ -0,0 +1,47 @@ +{ + pkgs, + lib, + ... +}: { + systemd.user.services.wluma = { + Unit = { + Description = "Automatic backlight control"; + PartOf = ["graphical-session.target"]; + }; + Service = { + ExecStart = lib.getExe pkgs.wluma; + Restart = "on-failure"; + }; + Install.WantedBy = ["graphical-session.target"]; + }; + + xdg.configFile."wluma/config.toml".source = (pkgs.formats.toml {}).generate "wluma-config" { + als.iio = { + path = "/sys/bus/iio/devices"; + thresholds = { + "0" = "night"; + "20" = "dark"; + "250" = "normal"; + "500" = "bright"; + "80" = "dim"; + "800" = "outdoors"; + }; + }; + + output.backlight = [ + { + capturer = "none"; + name = "eDP-1"; + path = "/sys/class/backlight/amdgpu_bl0"; + } + ]; + + # need to fix ddcutil first + # output.ddcutil = [ + # { + # capturer = "none"; + # name = "BenQ BL2283"; + # } + # ]; + }; +}