From a3aa87695d3b7fb141489cb3eaa137a2f4f6549b Mon Sep 17 00:00:00 2001 From: Devin Finlinson Date: Sat, 13 Jan 2024 10:02:37 -0700 Subject: added config for swayidle --- modules/home-manager/swayidle.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 modules/home-manager/swayidle.nix (limited to 'modules/home-manager/swayidle.nix') 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"; + }; +} -- cgit v1.2.3 From 1b73ac2ff1de54e375e38db7c9e904926e8e9198 Mon Sep 17 00:00:00 2001 From: Devin Finlinson Date: Sat, 13 Jan 2024 10:05:35 -0700 Subject: hyprctl is owned by hyprland package --- modules/home-manager/swayidle.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/home-manager/swayidle.nix') diff --git a/modules/home-manager/swayidle.nix b/modules/home-manager/swayidle.nix index 14c6831..d2974e1 100644 --- a/modules/home-manager/swayidle.nix +++ b/modules/home-manager/swayidle.nix @@ -4,7 +4,7 @@ systemdTarget = "hyprland-session.target"; timeouts = let - dpmsCommand = "${pkgs.hyprctl}/bin/hyprctl dispatch dpms"; + dpmsCommand = "${pkgs.hyprland}/bin/hyprctl dispatch dpms"; brightnessCommand = "${pkgs.brightnessctl}/bin/brightnessctl -s %% brightnessctl s"; in [ -- cgit v1.2.3 From 6c9ff5ce3efcea9f3d20f12cb293e7d6420570b5 Mon Sep 17 00:00:00 2001 From: Devin Finlinson Date: Sat, 13 Jan 2024 10:08:23 -0700 Subject: swayidle effects need to be configured like timers to work --- modules/home-manager/swayidle.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/home-manager/swayidle.nix') diff --git a/modules/home-manager/swayidle.nix b/modules/home-manager/swayidle.nix index d2974e1..d9fbc98 100644 --- a/modules/home-manager/swayidle.nix +++ b/modules/home-manager/swayidle.nix @@ -25,6 +25,6 @@ resumeCommand = "brightnessctl -r"; } ]; - events.before-sleep.event = "swaylock"; + # events.before-sleep.event = "swaylock"; }; } -- cgit v1.2.3 From 085b4c42e6dfca8e12ebfa68a421b91feec34986 Mon Sep 17 00:00:00 2001 From: Devin Finlinson Date: Sat, 13 Jan 2024 10:30:35 -0700 Subject: fixing swaylock config --- modules/home-manager/swayidle.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/home-manager/swayidle.nix') diff --git a/modules/home-manager/swayidle.nix b/modules/home-manager/swayidle.nix index d9fbc98..19cd171 100644 --- a/modules/home-manager/swayidle.nix +++ b/modules/home-manager/swayidle.nix @@ -16,7 +16,7 @@ { #timeout 300 timeout = 5; - command = "${dpmsCommand} off && swaylock --screenshots --clock --indicator-idle-visible --grace 10"; + command = "${dpmsCommand} off && swaylock"; resumeCommand = "${dpmsCommand} on"; } { #timeout 420 -- cgit v1.2.3