dpms off on idle

This commit is contained in:
Adithya 2023-04-09 20:36:56 +05:30
parent cf9ea43e97
commit 4975120fd2
Signed by: adtya
GPG key ID: 48FC9915FFD326D0

View file

@ -1,17 +1,27 @@
{ pkgs, ... }: { { pkgs, ... }:
let
swaylock = "${pkgs.swaylock}/bin/swaylock";
hyprctl = "${pkgs.hyprland}/bin/hyprctl";
in
{
services.swayidle = { services.swayidle = {
enable = true; enable = true;
systemdTarget = "graphical-session.target"; systemdTarget = "graphical-session.target";
events = [ events = [
{ {
event = "before-sleep"; event = "before-sleep";
command = "${pkgs.swaylock}/bin/swaylock -f -i /tmp/lockpaper.jpg"; command = "${swaylock} -f -i /tmp/lockpaper.jpg";
} }
]; ];
timeouts = [ timeouts = [
{ {
timeout = 600; timeout = 600;
command = "${pkgs.swaylock}/bin/swaylock -f -i /tmp/lockpaper.jpg"; command = "${swaylock} -f -i /tmp/lockpaper.jpg";
}
{
timeout = 900;
command = "${hyprctl} dispatch dpms off";
resumeCommand = "${hyprctl} dispatch dpms on";
} }
]; ];
}; };