summaryrefslogtreecommitdiff
path: root/modules/desktop/hypridle.nix
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-06-23 22:33:44 -0400
committerFreya Murphy <freya@freyacat.org>2025-06-23 22:33:44 -0400
commit328c741b1aac74020412e99e0dca7c728dbc92fa (patch)
tree461f4ebcd3252d542749a34668defd62de356c73 /modules/desktop/hypridle.nix
parentremoved unused packages (diff)
downloaddotfiles-nix-328c741b1aac74020412e99e0dca7c728dbc92fa.tar.gz
dotfiles-nix-328c741b1aac74020412e99e0dca7c728dbc92fa.tar.bz2
dotfiles-nix-328c741b1aac74020412e99e0dca7c728dbc92fa.zip
refactor
Diffstat (limited to 'modules/desktop/hypridle.nix')
-rw-r--r--modules/desktop/hypridle.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/modules/desktop/hypridle.nix b/modules/desktop/hypridle.nix
new file mode 100644
index 0000000..01d4996
--- /dev/null
+++ b/modules/desktop/hypridle.nix
@@ -0,0 +1,45 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ inherit (lib) mkIf;
+ cfg = config.desktop;
+in {
+ config = mkIf cfg.hypridle {
+ home-manager.users.${config.user} = {
+ services.hypridle = {
+ enable = true;
+
+ settings = {
+ general = {
+ lock_cmd = "pidof hyprlock || hyprlock";
+ before_sleep_cmd = "loginctl lock-session";
+ after_sleep_cmd = "hyprctl dispatch dpms on";
+ ignore_dbus_inhibit = false;
+ };
+
+ listener = [
+ # dim screen
+ {
+ timeout = 150;
+ on-timeout = "brightnessctl -s set 10";
+ on-resume = "brightnessctl -r";
+ }
+ # lock
+ {
+ timeout = 300;
+ on-timeout = "loginctl lock-session";
+ }
+ # turn off screen
+ {
+ timeout = 350;
+ on-timeout = "hyprctl dispatch dpms off";
+ on-resume = "hyprctl dispatch dpms on";
+ }
+ ];
+ };
+ };
+ };
+ };
+}