configuration.nix/home/wm/addon/swayidle.nix

29 lines
658 B
Nix
Raw Normal View History

2024-02-24 19:58:48 +05:30
{ config, ... }:
2023-11-04 16:12:45 +05:30
let
2024-01-04 21:51:25 +05:30
hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl";
2024-01-04 21:51:26 +05:30
swaylock = "${config.programs.swaylock.package}/bin/swaylock";
2023-11-04 16:12:45 +05:30
in
{
2023-04-07 19:21:33 +05:30
services.swayidle = {
enable = true;
systemdTarget = "graphical-session.target";
2023-04-07 19:21:33 +05:30
events = [
{
event = "before-sleep";
2024-02-24 19:58:48 +05:30
command = "${swaylock} -f -i /tmp/wallpaper.jpg";
2023-04-07 19:21:33 +05:30
}
];
timeouts = [
{
timeout = 600;
command = "${swaylock} -f -i /tmp/wallpaper.jpg";
2023-04-09 20:36:56 +05:30
}
{
timeout = 900;
command = "${hyprctl} dispatch dpms off";
resumeCommand = "${hyprctl} dispatch dpms on";
2023-04-07 19:21:33 +05:30
}
];
};
2023-03-15 22:11:59 +05:30
}