From 9615a0dbe009beb514cdf834ad16229fcdc63853 Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Sun, 20 Aug 2023 20:40:17 +0200 Subject: [PATCH] pinwheel: Add screen brightness control --- hosts/pinwheel/configuration.nix | 1 + hosts/pinwheel/modules/light/default.nix | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 hosts/pinwheel/modules/light/default.nix diff --git a/hosts/pinwheel/configuration.nix b/hosts/pinwheel/configuration.nix index fa9a498..f97bd67 100644 --- a/hosts/pinwheel/configuration.nix +++ b/hosts/pinwheel/configuration.nix @@ -12,6 +12,7 @@ ./modules/ssh ./modules/syncthing ./modules/firefox + ./modules/light ]; nix.settings.experimental-features = [ "nix-command" "flakes" ]; diff --git a/hosts/pinwheel/modules/light/default.nix b/hosts/pinwheel/modules/light/default.nix new file mode 100644 index 0000000..9c4d867 --- /dev/null +++ b/hosts/pinwheel/modules/light/default.nix @@ -0,0 +1,16 @@ +{ home-manager, pkgs, ... }: +{ + users.users.alex.extraGroups = [ "video" ]; + programs.light.enable = true; + + home-manager.users.alex = { + wayland.windowManager.hyprland = { + settings = { + bind = [ + ", XF86MonBrightnessUp, exec, ${pkgs.light}/bin/light -A 5" + ", XF86MonBrightnessDown, exec, ${pkgs.light}/bin/light -U 5" + ]; + }; + }; + }; +}