Modularise the hyprland config

This commit is contained in:
SebastianStork 2024-04-14 14:45:49 +02:00
parent 74982fa9f8
commit f6b56dae28
4 changed files with 96 additions and 75 deletions

View file

@ -0,0 +1,45 @@
{
inputs,
config,
pkgs,
lib,
...
}: {
imports = [
inputs.hyprlock.homeManagerModules.hyprlock
inputs.hypridle.homeManagerModules.hypridle
];
config = lib.mkIf config.myConfig.de.hyprland.enable {
programs.hyprlock = {
enable = true;
backgrounds = [
{
path = "screenshot";
blur_passes = 1;
blur_size = 6;
}
];
};
services.hypridle = let
hyprlockExe = "${lib.getExe inputs.hyprlock.packages.${pkgs.system}.default}";
in {
enable = true;
lockCmd = "pidof ${hyprlockExe} || ${hyprlockExe}";
# beforeSleepCmd = "loginctl lock-session";
afterSleepCmd = "hyprctl dispatch dpms on";
listeners = [
{
timeout = 600;
onTimeout = "hyprctl dispatch dpms off";
onResume = "hyprctl dispatch dpms on";
}
{
timeout = 1200;
onTimeout = "loginctl lock-session";
}
];
};
};
}