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": { "locked": {
"lastModified": 1714377222, "lastModified": 1716908526,
"narHash": "sha256-UsDsjWCKlWn8vbXi8Zza9Hkq3xyk8fpvFNo2VM5S74E=", "narHash": "sha256-Zl6e/sEVDh07K47XxDGPsXTYT4nI6llUDbQ4xMIwp7k=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "2af7c78b7bb9cf18406a193eba13ef9f99388f49", "rev": "373ead20606efa9181cd15ba19a5deac7ead1492",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

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