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;
services.gvfs.enable = true;
hardware.brillo.enable = true;
}

View file

@ -17,7 +17,6 @@ in {
# Hotkey dependencies
pkgs.playerctl
pkgs.brightnessctl
];
home.file.".background-image".source = cfg.wallpaper;
@ -37,6 +36,13 @@ in {
services.dunst.enable = true;
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 =
if cfg.widget.backlight.enable
then ''
@ -47,7 +53,7 @@ in {
batteryWidget =
if cfg.widget.battery.enable
then ''
widget.Sep(),
widget.Sep(),
widget.Battery(format="󰁹 {percent:2.0%}"),
''
else "";
@ -100,8 +106,7 @@ in {
Key([], "XF86AudioRaiseVolume", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"), desc="Raise volume"),
# Brightness controls
Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl set +5%"), desc="Raise brightness"),
Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl set 5%-"), desc="Lower brightness"),
${backlightKeys}
# Move window focus
Key([mod], left, lazy.layout.left(), desc="Move focus to left"),

View file

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