From dda78546c9586fb710fec3add9d51498b9c3bd8b Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Fri, 17 Nov 2023 14:57:34 +0100 Subject: [PATCH] Swayidle --- flake.nix | 2 ++ modules/hm/hyprland.nix | 1 - modules/hm/swayidle.nix | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 modules/hm/swayidle.nix diff --git a/flake.nix b/flake.nix index 22d318a..f738a9d 100644 --- a/flake.nix +++ b/flake.nix @@ -140,6 +140,7 @@ { home-manager.users.bertof.imports = [ ./modules/hm/hyprland.nix + ./modules/hm/swayidle.nix ]; } ] ++ homeManagerModules ++ [ @@ -168,6 +169,7 @@ { home-manager.users.bertof.imports = [ ./modules/hm/hyprland.nix + ./modules/hm/swayidle.nix ]; } ] ++ homeManagerModules ++ [ diff --git a/modules/hm/hyprland.nix b/modules/hm/hyprland.nix index 7eb9e05..55c0e32 100644 --- a/modules/hm/hyprland.nix +++ b/modules/hm/hyprland.nix @@ -11,7 +11,6 @@ # wayland.windowManager.hyprland = { }; - xdg.configFile."hypr/hyprland.conf".text = let strPalette = pkgs.lib.nix-rice.palette.toRgbaShortHex pkgs.rice.colorPalette; diff --git a/modules/hm/swayidle.nix b/modules/hm/swayidle.nix new file mode 100644 index 0000000..e983b5f --- /dev/null +++ b/modules/hm/swayidle.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: { + services.swayidle = { + enable = true; + events = [ + { event = "before-sleep"; command = "${pkgs.way-lockscreen}/bin/way-lockscreen"; } + { event = "lock"; command = "${pkgs.way-lockscreen}/bin/way-lockscreen"; } + ]; + timeouts = [ + { timeout = 60; command = "${pkgs.way-lockscreen}/bin/way-lockscreen"; } + ]; + }; +}