Skip to content

Commit

Permalink
SwayOSD udev rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Octelly committed Mar 10, 2024
1 parent ab44f0b commit 3897c90
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions modules/hardware/brightness.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ with builtins;
with lib;
let cfg = config.modules.hardware.brightness;
in {
options.modules.hardware.brightness = {
enable = mkEnableOption "brightness";
};
options.modules.hardware.brightness = {
enable = mkEnableOption "brightness";
};

config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ brightnessctl ];
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ brightnessctl ];

# SwayOSD brightness controls don't work without this
# See https://github.com/ErikReider/SwayOSD?tab=readme-ov-file#brightness-control
# (it should essentially give access to `/sys/class/backlight/*/brightness` to the `video` group)
services.udev.packages = with pkgs; [ swayosd ];
# note: SwayOSD doesn't even give you an error message when this isn't set correctly
};
}

0 comments on commit 3897c90

Please sign in to comment.