mirror of
https://github.com/nickolaj-jepsen/nixos.git
synced 2026-01-22 08:06:50 +01:00
feat: implement hyprlock and hypridle
This commit is contained in:
parent
870f8fdde5
commit
0d47ab58f5
4 changed files with 146 additions and 8 deletions
34
modules/desktop/hyprland/hypridle.nix
Normal file
34
modules/desktop/hyprland/hypridle.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
sleep_cmd = "${config.programs.hyprland.package}/bin/hyprctl dispatch dpms off";
|
||||
wake_cmd = "${config.programs.hyprland.package}/bin/hyprctl dispatch dpms on";
|
||||
lock_cmd = "pidof ${pkgs.hyprlock}/bin/hyprlock || ${pkgs.hyprlock}/bin/hyprlock";
|
||||
in {
|
||||
config = {
|
||||
fireproof.home-manager.services.hypridle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
inherit lock_cmd;
|
||||
before_sleep_cmd = "${pkgs.systemd}/bin/loginctl lock-session";
|
||||
after_sleep_cmd = sleep_cmd;
|
||||
};
|
||||
listener = [
|
||||
{
|
||||
timeout = 60 * 5;
|
||||
on-timeout = lock_cmd;
|
||||
}
|
||||
{
|
||||
timeout = 60 * 15;
|
||||
on-timeout = sleep_cmd;
|
||||
on-resume = wake_cmd;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue