mirror of
https://github.com/nickolaj-jepsen/nixos.git
synced 2026-01-22 16:16:50 +01:00
refactor: prepare new modules structure
This commit is contained in:
parent
d25e24c15b
commit
bf82970b9e
65 changed files with 94 additions and 94 deletions
33
legacy_modules/desktop/hyprland/hypridle.nix
Normal file
33
legacy_modules/desktop/hyprland/hypridle.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
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