diff options
| author | Devin Finlinson <devin.finlinson@pm.me> | 2024-02-02 13:37:54 -0700 |
|---|---|---|
| committer | Devin Finlinson <devin.finlinson@pm.me> | 2024-02-02 13:37:54 -0700 |
| commit | e776c8fb5aed61d0f5f27a87c9c419dc07a13480 (patch) | |
| tree | bce36bc077042d60c0cc162205440df6b783acdf /modules/home-manager/swayidle.nix | |
| parent | 930ed23a02259a35c404f2fef0ab61ca620a0e4b (diff) | |
| parent | 60568d28f263c74847f06ec6bc4c8ba7f7125dce (diff) | |
merge
Diffstat (limited to 'modules/home-manager/swayidle.nix')
| -rw-r--r-- | modules/home-manager/swayidle.nix | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/modules/home-manager/swayidle.nix b/modules/home-manager/swayidle.nix new file mode 100644 index 0000000..19cd171 --- /dev/null +++ b/modules/home-manager/swayidle.nix @@ -0,0 +1,30 @@ +{ pkgs, ... }: { + services.swayidle = { + enable = true; + systemdTarget = "hyprland-session.target"; + timeouts = + let + dpmsCommand = "${pkgs.hyprland}/bin/hyprctl dispatch dpms"; + brightnessCommand = "${pkgs.brightnessctl}/bin/brightnessctl -s %% brightnessctl s"; + in + [ + { #timeout 180 + timeout = 3; + command = "${brightnessCommand} 15%"; + resumeCommand = "brightnessctl -r"; + } + { + #timeout 300 + timeout = 5; + command = "${dpmsCommand} off && swaylock"; + resumeCommand = "${dpmsCommand} on"; + } + { #timeout 420 + timeout = 7; + command = "${brightnessCommand} 0%"; + resumeCommand = "brightnessctl -r"; + } + ]; + # events.before-sleep.event = "swaylock"; + }; +} |
