diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/home-manager/swayidle.nix | 30 | ||||
| -rw-r--r-- | modules/nixos/hyprland.nix | 3 |
2 files changed, 32 insertions, 1 deletions
diff --git a/modules/home-manager/swayidle.nix b/modules/home-manager/swayidle.nix new file mode 100644 index 0000000..14c6831 --- /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.hyprctl}/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 --screenshots --clock --indicator-idle-visible --grace 10"; + resumeCommand = "${dpmsCommand} on"; + } + { #timeout 420 + timeout = 7; + command = "${brightnessCommand} 0%"; + resumeCommand = "brightnessctl -r"; + } + ]; + events.before-sleep.event = "swaylock"; + }; +} diff --git a/modules/nixos/hyprland.nix b/modules/nixos/hyprland.nix index 42d061e..4ab6088 100644 --- a/modules/nixos/hyprland.nix +++ b/modules/nixos/hyprland.nix @@ -51,7 +51,8 @@ waybar # the status bar swaybg # the wallpaper swayidle # the idle timeout - swaylock # locking the screen + swaylock-effects # locking the screen + brightnessctl # control device brightness wlogout # logout menu wl-clipboard # copying and pasting hyprpicker # color picker |
