uhhh
uhhh the 2nd rendition
This commit is contained in:
parent
132a109da8
commit
565aac949c
37 changed files with 2606 additions and 36 deletions
43
modules/desktop/hypridle.nix
Normal file
43
modules/desktop/hypridle.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ lib, config, pkgs, system, inputs , ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.hypridle;
|
||||
in {
|
||||
options.modules.desktop.hypridle = {
|
||||
enable = mkEnableOption "Enable hypridle, hyprland's idle daemon";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = inputs.hypridle.packages.${system}.hypridle;
|
||||
example = "pkgs.hypridle";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.services.hypridle = {
|
||||
enable = true;
|
||||
package = cfg.package;
|
||||
|
||||
lockCmd = "${lib.getExe config.modules.desktop.hyprlock.package}";
|
||||
unlockCmd = "pkill -USR1 hyprlock";
|
||||
|
||||
listeners = let
|
||||
hyprctl = "${config.modules.desktop.hyprland.package}/bin/hyprctl";
|
||||
in [
|
||||
{
|
||||
timeout = 90; # 1.5 min
|
||||
onTimeout = "${hyprctl} dispatch dpms off"; # turn off screen
|
||||
onResume = "${hyprctl} dispatch dpms on"; # turn it back on
|
||||
}
|
||||
{
|
||||
timeout = 60 * 2; # 2 min
|
||||
onTimeout = "loginctl lock-session"; # lock computer
|
||||
}
|
||||
{
|
||||
timeout = 60 * 30; # 15 min
|
||||
onTimeout = "systemctl suspend"; # sleep/suspend
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue