This commit is contained in:
hand7s 2025-04-21 18:32:39 +03:00
commit b6cdc78668
210 changed files with 9929 additions and 0 deletions

View file

@ -0,0 +1,39 @@
{
config,
pkgs,
lib,
...
}: {
services = {
hypridle = {
enable = lib.mkIf (
config.home.gui.sessionType == "Hyprland"
) true;
settings = {
general = {
before_sleep_cmd = "${pkgs.hyprland}/bin/hyprctl dispatch dpms off";
after_sleep_cmd = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on";
};
listener = [
{
timeout = 300;
on-timeout = "${pkgs.brightnessctl}/bin/brightnessctl -s set 10";
on-resume = "${pkgs.brightnessctl}/bin/brightnessctl -r";
}
{
timeout = 600;
on-timeout = "${pkgs.hyprlock}/bin/hyprlock";
}
{
timeout = 900;
on-timeout = "${pkgs.systemd}/bin/systemctl suspend";
}
];
};
};
};
}

View file

@ -0,0 +1,49 @@
{
config,
pkgs,
lib,
...
}: {
services = {
swayidle = {
enable = lib.mkIf (
config.home.gui.sessionType == "Sway"
) true;
events = [
{
event = "lock";
command = "${pkgs.swaylock}/bin/swaylock";
}
{
event = "before-sleep";
command = "${pkgs.sway}/bin/swaymsg 'output * power off'";
}
{
event = "after-resume";
command = "${pkgs.sway}/bin/swaymsg 'output * power on'";
}
];
timeouts = [
{
timeout = 300;
command = "${pkgs.brightnessctl}/bin/brightnessctl -s set 10";
resumeCommand = "${pkgs.brightnessctl}/bin/brightnessctl -r";
}
{
timeout = 600;
command = "${pkgs.swaylock}/bin/swaylock";
}
{
timeout = 900;
command = "${pkgs.systemd}/bin/systemctl suspend";
}
];
};
};
}