36 lines
919 B
Nix
Raw Normal View History

2021-09-16 01:03:52 +03:00
{ config, pkgs, lib, ... }: {
2021-02-07 02:38:11 +03:00
programs.light.enable = config.deviceSpecific.isLaptop;
2019-09-11 17:17:56 +04:00
services.actkbd = {
2021-02-07 02:38:11 +03:00
enable = config.deviceSpecific.isLaptop;
2019-09-11 17:17:56 +04:00
bindings = map (x:
2021-09-16 01:03:52 +03:00
x // {
events = [ "key" ];
attributes = [ "exec" ];
}) [
{
keys = [ 225 ];
command = "${pkgs.light}/bin/light -A 10";
}
{
keys = [ 224 ];
command = "${pkgs.light}/bin/light -U 10";
}
{
keys = [ 431 ];
2023-01-26 02:12:00 +03:00
command = toString (pkgs.writeTextFile {
2021-09-16 01:03:52 +03:00
name = "dark-script";
text = ''
if [[ `${pkgs.light}/bin/light` -eq 0 ]]
then
${pkgs.light}/bin/light -I
else
${pkgs.light}/bin/light -O
${pkgs.light}/bin/light -S 0
fi'';
executable = true;
2023-01-26 02:12:00 +03:00
});
2021-09-16 01:03:52 +03:00
}
];
2019-09-11 17:17:56 +04:00
};
}