.dotfiles/modules/home/common/swayidle.nix
Leon Schwarzäugl 91f4393800
Some checks failed
Build and Deploy / build (push) Has been cancelled
Flake check / Check flake (push) Has been cancelled
Build and Deploy / deploy (push) Has been cancelled
feat[client]: add shikane
2026-02-23 01:02:44 +01:00

37 lines
1.8 KiB
Nix

{ lib, config, pkgs, ... }:
let
moduleName = "swayidle";
in
{
options.swarselmodules.${moduleName} = lib.mkEnableOption "enable ${moduleName} and settings";
config = lib.mkIf config.swarselmodules.${moduleName} {
services.${moduleName} =
let
brightnessctl = "${lib.getExe pkgs.brightnessctl}";
swaylock = "${lib.getExe pkgs.swaylock-effects}";
suspend = "${pkgs.systemd}/bin/systemctl suspend";
noctalia = "/etc/profiles/per-user/${config.swarselsystems.mainUser}/bin/noctalia-shell ipc call";
in
{
enable = true;
# systemdTarget = "sway-session.target";
extraArgs = [ "-w" ];
timeouts = [
{ timeout = 60; command = "${brightnessctl} -s; ${brightnessctl} set 80%-"; resumeCommand = "${brightnessctl} -r"; }
# { timeout = 300; command = "${lib.getExe pkgs.swaylock-effects} -f --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2"; }
# { timeout = 300; command = "${swaylock} -f"; }
{ timeout = 300; command = "${noctalia} lockScreen lock || ${swaylock} -f"; }
# { timeout = 600; command = ''${pkgs.sway}/bin/swaymsg "output * dpms off"; resumeCommand = "${pkgs.sway}/bin/swaymsg output * dpms on''; }
# { timeout = 600; command = "${noctalia} sessionMenu lockAndSuspend || ${suspend}"; }
{ timeout = 600; command = "${suspend}"; }
];
events = {
# { event = "before-sleep"; command = "${noctalia} lockScreen lock || ${lib.getExe pkgs.swaylock-effects} -f --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2"; }
# { event = "after-resume"; command = "${swaylock} -f "; }
before-sleep = "${noctalia} lockScreen lock || ${swaylock} -f ";
# lock = "${swaylock} -f ";
};
};
};
}