2024-01-04 21:51:26 +05:30
|
|
|
{ lib, pkgs, config, osConfig, ... }:
|
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";
|
|
|
|
waydroid = "${pkgs.waydroid}/bin/waydroid";
|
|
|
|
waydroidEnabled = osConfig.virtualisation.waydroid.enable;
|
2023-11-04 16:12:45 +05:30
|
|
|
in
|
|
|
|
{
|
2023-04-07 19:21:33 +05:30
|
|
|
services.swayidle = {
|
|
|
|
enable = true;
|
2023-04-08 14:40:44 +05:30
|
|
|
systemdTarget = "graphical-session.target";
|
2023-04-07 19:21:33 +05:30
|
|
|
events = [
|
|
|
|
{
|
|
|
|
event = "before-sleep";
|
2024-01-04 21:51:26 +05:30
|
|
|
command = "${lib.optionalString waydroidEnabled "${waydroid} session stop; "}${swaylock} -f -i /tmp/wallpaper.jpg";
|
2023-04-07 19:21:33 +05:30
|
|
|
}
|
|
|
|
];
|
|
|
|
timeouts = [
|
|
|
|
{
|
|
|
|
timeout = 600;
|
2024-01-04 21:51:25 +05:30
|
|
|
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
|
|
|
}
|