Migrate services from wrappers to systemd services

This commit is contained in:
SebastianStork 2024-08-14 00:54:54 +02:00
parent e1ba06a5fb
commit aceeeef689
13 changed files with 291 additions and 247 deletions

View file

@ -0,0 +1,46 @@
{
config,
pkgs,
lib,
wrappers,
...
}:
{
options.myConfig.de.hypridle.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.de.hypridle.enable {
home.packages = [
wrappers.hyprlock
pkgs.brightnessctl
(pkgs.writeScriptBin "lock-suspend" "loginctl lock-session && sleep 0.5 && systemctl suspend")
];
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "pidof hyprlock || hyprlock";
after_sleep_cmd = "hyprctl dispatch dpms on";
};
listener = [
{
timeout = 300;
on-timeout = "brightnessctl -s && brightnessctl -e set 10%";
on-resume = "brightnessctl -r";
}
{
timeout = 600;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
{
timeout = 610;
on-timeout = "loginctl lock-session";
}
];
};
};
};
}