Enable hyprlock and hypridle

This commit is contained in:
SebastianStork 2024-04-12 01:18:09 +02:00
parent 61b00efc83
commit bf792236bc
3 changed files with 180 additions and 2 deletions

View file

@ -1,4 +1,5 @@
{
inputs,
config,
pkgs,
lib,
@ -6,6 +7,11 @@
}: let
cfg = config.myConfig.de;
in {
imports = [
inputs.hyprlock.homeManagerModules.hyprlock
inputs.hypridle.homeManagerModules.hypridle
];
options.myConfig.de.hyprland.enable = lib.mkEnableOption "";
config = lib.mkIf cfg.hyprland.enable {
@ -16,6 +22,34 @@ in {
splash=false
'';
programs.hyprlock = {
enable = true;
};
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 = 300;
onTimeout = "hyprctl dispatch dpms off";
onResume = "hyprctl dispatch dpms on";
}
{
timeout = 600;
onTimeout = "loginctl lock-session";
}
{
timeout = 1200;
onTimeout = "systemctl suspend";
}
];
};
myConfig.rofi.enable = true;
services.cliphist.enable = true;