refactor(hypridle): simplify configuration
This commit is contained in:
parent
2130903850
commit
b4862ad6e2
1 changed files with 3 additions and 9 deletions
|
|
@ -3,13 +3,6 @@
|
|||
let
|
||||
cfg = config.homeModules.desktop.wayland.lockscreen.hyprlock;
|
||||
inherit (config.colorscheme) colors;
|
||||
suspendScript = pkgs.writeShellScript "suspend-script" ''
|
||||
${pkgs.pipewire}/bin/pw-cli i all 2>&1 | ${pkgs.ripgrep}/bin/rg running -q
|
||||
# only suspend if audio isn't running
|
||||
if [ $? == 1 ]; then
|
||||
${pkgs.systemd}/bin/systemctl suspend
|
||||
fi
|
||||
'';
|
||||
in
|
||||
|
||||
{
|
||||
|
|
@ -79,13 +72,14 @@ in
|
|||
};
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
package = pkgs.hypridle;
|
||||
beforeSleepCmd = "${pkgs.systemd}/bin/loginctl lock-session";
|
||||
lockCmd = lib.getExe config.programs.hyprlock.package;
|
||||
|
||||
listeners = [
|
||||
{
|
||||
timeout = 330;
|
||||
onTimeout = suspendScript.outPath;
|
||||
timeout = 500;
|
||||
onTimeout = lib.getExe config.programs.hyprlock.package;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue