From 5f49b356625ee735c1082b039500cdac69158512 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Wed, 30 Nov 2022 19:24:01 +0100 Subject: [PATCH] Configure swayidle for hyprland --- home-manager/modules/hyprland/default.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/home-manager/modules/hyprland/default.nix b/home-manager/modules/hyprland/default.nix index a05d120..ab41637 100644 --- a/home-manager/modules/hyprland/default.nix +++ b/home-manager/modules/hyprland/default.nix @@ -106,7 +106,7 @@ in bind = $mod_SHIFT,Minus,movetoworkspacesilent,special bind = $mod,Minus,togglespecialworkspace - bind = $mod_SHIFT,C,exec,hyprctl reload + bind = $mod_SHIFT,C,exec,${config.wayland.windowManager.hyprland.package}/bin/hyprctl reload bind = $mod_SHIFT,F,exec,${powerMenu} bind = $mod,L,exec,${swaylockcmd} @@ -143,5 +143,21 @@ in '' + (lib.optionalString config.eboskma.programs.emacs.enable "bind = $mod,C,exec,${config.eboskma.programs.emacs.package}/bin/emacsclient -c"); }; + + systemd.user.services.hypridle = { + Unit = { + Description = "Idle manager for Wayland (Hyprland)"; + Documentation = "man:swayidle(1)"; + PartOf = "graphical-session.target"; + }; + + Service = { + ExecStart = "${pkgs.swayidle}/bin/swayidle -w timeout 900 '${swaylockcmd}' timeout 1200 '${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off' resume '${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms on'"; + }; + + Install = { + WantedBy = [ "hyprland-session.target" ]; + }; + }; }; }