61 lines
1.8 KiB
Nix
61 lines
1.8 KiB
Nix
{ inputs, ... }:
|
|
{
|
|
services.hypridle = {
|
|
enable = true;
|
|
package = inputs.hypridle.packages.x86_64-linux.default;
|
|
settings = {
|
|
general = {
|
|
lock_cmd = "/home/emenel/.local/bin/session-lock";
|
|
before_sleep_cmd = "loginctl lock-session";
|
|
after_sleep_cmd = "/home/emenel/.local/bin/on-unlock";
|
|
ignore_dbus_inhibit = false;
|
|
ignore_systemd_inhibit = false;
|
|
};
|
|
|
|
listener = [
|
|
{
|
|
timeout = "60";
|
|
on-timeout = "/home/emenel/.local/bin/dim-all-monitors";
|
|
on-resume = "/home/emenel/.local/bin/on-unlock";
|
|
}
|
|
|
|
# battery timers
|
|
{
|
|
timeout = "90";
|
|
on-timeout = "systemd-ac-power || loginctl lock-session";
|
|
on-resume = "/home/emenel/.local/bin/on-unlock";
|
|
}
|
|
{
|
|
timeout = "120";
|
|
on-timeout = "systemd-ac-power || /home/emenel/.local/bin/lock-power-off-monitors";
|
|
on-resume = "/home/emenel/.local/bin/on-unlock";
|
|
}
|
|
{
|
|
timeout = "180";
|
|
on-timeout = "systemd-ac-power || /home/emenel/.local/bin/lock-suspend";
|
|
on-resume = "/home/emenel/.local/bin/on-unlock";
|
|
}
|
|
|
|
# ac power timers
|
|
{
|
|
timeout = "180";
|
|
on-timeout = "systemd-ac-power && loginctl lock-session";
|
|
on-resume = "/home/emenel/.local/bin/on-unlock";
|
|
}
|
|
|
|
{
|
|
timeout = "240";
|
|
on-timeout = "systemd-ac-power && /home/emenel/.local/bin/lock-power-off-monitors";
|
|
on-resume = "/home/emenel/.local/bin/on-unlock";
|
|
}
|
|
|
|
{
|
|
timeout = "600";
|
|
on-timeout = "systemd-ac-power && /home/emenel/.local/bin/lock-suspend";
|
|
on-resume = "/home/emenel/.local/bin/on-unlock";
|
|
}
|
|
];
|
|
|
|
};
|
|
};
|
|
}
|