diff options
| author | Devin Finlinson <devin.finlinson@pm.me> | 2024-01-26 17:42:10 +0000 |
|---|---|---|
| committer | Devin Finlinson <devin.finlinson@pm.me> | 2024-01-26 17:42:10 +0000 |
| commit | 053d4ebb58ea9a9d0e3ee98c14f1f5c375f57556 (patch) | |
| tree | e1ee576269532ca638d9d7d90c0b216d63cf9edc /modules/home-manager/swayidle.nix | |
| parent | e4801c21871f82a8a427b6657d87ecb9a9202c13 (diff) | |
| parent | fb96c957c3b0d1226d965195ab637f1be6250618 (diff) | |
merging zenbook branch to bosco
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"; + }; +} |
