Switch to the backlight controller brillo

This commit is contained in:
SebastianStork 2024-04-02 22:36:14 +02:00
parent f6ce8165b6
commit fb9ecf85a0
3 changed files with 12 additions and 5 deletions

View file

@ -31,4 +31,6 @@
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
services.gvfs.enable = true; services.gvfs.enable = true;
hardware.brillo.enable = true;
} }

View file

@ -17,7 +17,6 @@ in {
# Hotkey dependencies # Hotkey dependencies
pkgs.playerctl pkgs.playerctl
pkgs.brightnessctl
]; ];
home.file.".background-image".source = cfg.wallpaper; home.file.".background-image".source = cfg.wallpaper;
@ -37,6 +36,13 @@ in {
services.dunst.enable = true; services.dunst.enable = true;
xdg.configFile."qtile/config.py".text = let xdg.configFile."qtile/config.py".text = let
backlightKeys =
if cfg.widget.backlight.enable
then ''
Key([], "XF86MonBrightnessUp", lazy.spawn("brillo -q -s ${cfg.widget.backlight.device} -u 50000 -A 4"), desc="Raise brightness"),
Key([], "XF86MonBrightnessDown", lazy.spawn("brillo -q -s ${cfg.widget.backlight.device} -u 50000 -U 4"), desc="Lower brightness"),
''
else "";
backlightWidget = backlightWidget =
if cfg.widget.backlight.enable if cfg.widget.backlight.enable
then '' then ''
@ -100,8 +106,7 @@ in {
Key([], "XF86AudioRaiseVolume", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"), desc="Raise volume"), Key([], "XF86AudioRaiseVolume", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"), desc="Raise volume"),
# Brightness controls # Brightness controls
Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl set +5%"), desc="Raise brightness"), ${backlightKeys}
Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl set 5%-"), desc="Lower brightness"),
# Move window focus # Move window focus
Key([mod], left, lazy.layout.left(), desc="Move focus to left"), Key([mod], left, lazy.layout.left(), desc="Move focus to left"),

View file

@ -7,7 +7,7 @@
isNormalUser = true; isNormalUser = true;
description = "Sebastian Stork"; description = "Sebastian Stork";
hashedPasswordFile = config.sops.secrets."password/seb".path; hashedPasswordFile = config.sops.secrets."password/seb".path;
extraGroups = ["wheel" "networkmanager" "libvirtd"]; extraGroups = ["wheel" "networkmanager" "libvirtd" "video"];
}; };
home-manager.users.seb = ./home.nix; home-manager.users.seb = ./home.nix;