Kieran's opinionated (and probably slightly dumb) nix config
1{
2 lib,
3 config,
4 ...
5}:
6{
7 config = lib.mkIf config.atelier.wm.hyprland.enable {
8 services.hypridle = {
9 enable = true;
10 settings = {
11 general = {
12 after_sleep_cmd = "hyprctl dispatch dpms on";
13 before_sleep_cmd = "hyprlock";
14 ignore_dbus_inhibit = false;
15 lock_cmd = "pidof hyprlock || hyprlock";
16 };
17
18 listener = [
19 {
20 timeout = 30;
21 on-timeout = "kill $(pidof wluma); brightnessctl -s set 10";
22 on-resume = "brightnessctl -r; wluma &";
23 }
24 {
25 timeout = 45;
26 on-timeout = "loginctl lock-session";
27 }
28 {
29 timeout = 90;
30 on-timeout = "hyprctl dispatch dpms off";
31 on-resume = "hyprctl dispatch dpms on";
32 }
33 {
34 timeout = 150;
35 on-timeout = "systemctl suspend";
36 }
37 ];
38 };
39 };
40 };
41}