Swayidle: fix screen brightness with brillo

This commit is contained in:
Filippo Berto 2024-02-08 15:00:33 +01:00
parent 2ab8ef98d7
commit 81ff9e822e
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056

View file

@ -1,4 +1,6 @@
{ pkgs, ... }: {
home.packages = builtins.attrValues { inherit (pkgs) brillo; };
services.swayidle = {
enable = true;
events = [
@ -6,7 +8,16 @@
{ event = "lock"; command = "${pkgs.way-lockscreen}/bin/way-lockscreen"; }
];
timeouts = [
{ timeout = 120; command = "${pkgs.way-lockscreen}/bin/way-lockscreen"; }
{
timeout = 30;
command = "${pkgs.brillo}/bin/brillo -e -O; ${pkgs.brillo}/bin/brillo -e -S 30";
resumeCommand = "${pkgs.brillo}/bin/brillo -e -I";
}
{
timeout = 120;
command = "${pkgs.brillo}/bin/brillo -e -S 0; ${pkgs.way-lockscreen}/bin/way-lockscreen";
resumeCommand = "${pkgs.brillo}/bin/brillo -e -I";
}
];
};
}