diff --git a/hosts/niks/configuration.nix b/hosts/niks/configuration.nix index fd61ce02..bbfde38a 100644 --- a/hosts/niks/configuration.nix +++ b/hosts/niks/configuration.nix @@ -337,9 +337,26 @@ wantedBy = [ "sleep.target" ]; }; - #"resume@" = { - # - #}; + "resume@" = { + description = "Unit resume actions"; + after = [ "suspend.target" ]; + + serviceConfig = { + User = "%I"; + Type = "forking"; + }; + + environment = { + DISPLAY = ":0"; + }; + + script = '' + ${inputs.hyprland.packages.${pkgs.system}.hyprland}/bin/hyprctl dispatch dpms off HDMI-A-1 + ${inputs.hyprland.packages.${pkgs.system}.hyprland}/bin/hyprctl dispatch dpms on HDMI-A-1 + ''; + + wantedBy = [ "sleep.target" ]; + }; }; # this makes usb devices autosuspend