527 current 2024-05-05 13:46:54 24.05.20240503.e9be424 6.8.6-zen1 *
This commit is contained in:
parent
2c7e0abaa5
commit
fe9a25d1f8
3 changed files with 175 additions and 101 deletions
|
|
@ -3,6 +3,7 @@
|
|||
lib,
|
||||
config,
|
||||
theme,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
suspendScript = pkgs.writeShellScript "suspend-script" ''
|
||||
|
|
@ -54,34 +55,32 @@ in {
|
|||
ignore-empty-password = true;
|
||||
};
|
||||
};
|
||||
services.swayidle = {
|
||||
enable = true;
|
||||
events = [
|
||||
{
|
||||
event = "before-sleep";
|
||||
command = "${pkgs.swaylock-effects}/bin/swaylock -fF";
|
||||
}
|
||||
{
|
||||
event = "lock";
|
||||
command = "${pkgs.swaylock-effects}/bin/swaylock -fF";
|
||||
}
|
||||
{
|
||||
event = "lock";
|
||||
command = "${pkgs.gtklock}/bin/gtklock";
|
||||
}
|
||||
];
|
||||
timeouts = [
|
||||
{
|
||||
timeout = 300;
|
||||
command = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off";
|
||||
resumeCommand = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms on";
|
||||
}
|
||||
{
|
||||
timeout = 310;
|
||||
command = suspendScript.outPath;
|
||||
}
|
||||
];
|
||||
|
||||
systemd.user.services.hypridle = {
|
||||
Unit = {
|
||||
Description = "Idle Daemon for Hyprland";
|
||||
};
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = lib.getExe inputs.hypridle.packages.${pkgs.system}.hypridle;
|
||||
Restart = "on-failure";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = ["hyprland-session.target"];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.swayidle.Install.WantedBy = lib.mkForce ["hyprland-session.target"];
|
||||
xdg.configFile."hypr/hypridle.conf".text = ''
|
||||
general {
|
||||
lock_cmd = ${pkgs.swaylock-effects}/bin/swaylock -fF
|
||||
before_sleep_cmd = ${pkgs.swaylock-effects}/bin/swaylock -fF # command ran before sleep
|
||||
ignore_dbus_inhibit = false # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam)
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 300 # in seconds
|
||||
on-timeout = ${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off
|
||||
on-resume = ${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms on
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue