2024-02-15 17:04:34 +01:00
|
|
|
{
|
|
|
|
inputs,
|
2024-07-05 00:41:59 +02:00
|
|
|
lib,
|
2024-02-15 17:04:34 +01:00
|
|
|
pkgs,
|
|
|
|
...
|
2024-07-24 18:47:53 +02:00
|
|
|
}: let
|
|
|
|
inherit (lib.meta) getExe getExe';
|
2024-07-05 00:41:59 +02:00
|
|
|
|
2024-07-24 18:47:53 +02:00
|
|
|
mpc = getExe pkgs.mpc-cli;
|
|
|
|
sleep = getExe' pkgs.coreutils-full "sleep";
|
2024-10-13 23:25:45 +02:00
|
|
|
hyprctl = getExe' inputs.hyprland.packages.${pkgs.stdenv.system}.hyprland "hyprctl";
|
2024-07-24 18:47:53 +02:00
|
|
|
in {
|
|
|
|
powerManagement = {
|
2024-02-15 17:04:34 +01:00
|
|
|
enable = true;
|
|
|
|
powerDownCommands = ''
|
2024-07-05 00:41:59 +02:00
|
|
|
${mpc} pause
|
|
|
|
${sleep} 1
|
2024-02-15 17:04:34 +01:00
|
|
|
'';
|
|
|
|
powerUpCommands = ''
|
2024-07-05 00:41:59 +02:00
|
|
|
${hyprctl} dispatch dpms off HDMI-A-1
|
|
|
|
${hyprctl} dispatch dpms on HDMI-A-1
|
2024-02-15 17:04:34 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|