hyprland: Use home-manager module for hypridle

This commit is contained in:
Donovan Glover 2024-05-28 13:01:29 -04:00
parent f80d3c356d
commit 1462c868b6
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 33 additions and 32 deletions

6
flake.lock generated
View File

@ -170,11 +170,11 @@
]
},
"locked": {
"lastModified": 1714377222,
"narHash": "sha256-UsDsjWCKlWn8vbXi8Zza9Hkq3xyk8fpvFNo2VM5S74E=",
"lastModified": 1716908526,
"narHash": "sha256-Zl6e/sEVDh07K47XxDGPsXTYT4nI6llUDbQ4xMIwp7k=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "2af7c78b7bb9cf18406a193eba13ef9f99388f49",
"rev": "373ead20606efa9181cd15ba19a5deac7ead1492",
"type": "github"
},
"original": {

View File

@ -19,7 +19,6 @@ in
home.packages = with pkgs; [
hyprdim
hyprnome
hypridle
hyprlock
hyprshade
swww
@ -73,7 +72,6 @@ in
"hyprctl dispatch workspace 5000000"
"${polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
"hyprdim --no-dim-when-only --persist --ignore-leaving-special --dialog-dim"
"hypridle"
"sleep 1 && eww open desktop-icons"
"~/.config/${randomBackgroundScript}"
];
@ -389,33 +387,36 @@ in
}
'';
xdg.configFile."hypr/hypridle.conf".text = /* bash */ ''
general {
lock_cmd = pidof hyprlock || hyprlock
before_sleep_cmd = loginctl lock-session
after_sleep_cmd = hyprctl dispatch dpms on
}
services.hypridle = {
enable = true;
listener {
timeout = 150
on-timeout = brightnessctl -s set 10
on-resume = brightnessctl -r
}
settings = {
general = {
lock_cmd = "pidof hyprlock || hyprlock";
before_sleep_cmd = "loginctl lock-session";
after_sleep_cmd = "hyprctl dispatch dpms on";
};
listener {
timeout = 300
on-timeout = loginctl lock-session
}
listener {
timeout = 380
on-timeout = hyprctl dispatch dpms off
on-resume = hyprctl dispatch dpms on
}
listener {
timeout = 1800
on-timeout = systemctl suspend
}
'';
listener = [
{
timeout = 150;
on-timeout = "brightnessctl -s set 10";
on-resume = "brightnessctl -r";
}
{
timeout = 300;
on-timeout = "loginctl lock-session";
}
{
timeout = 380;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
{
timeout = 1800;
on-timeout = "systemctl suspend";
}
];
};
};
}