From a2891699f405c475e2366a44e62af3d08aee52b9 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Wed, 14 Feb 2024 15:16:06 +0100 Subject: [PATCH] add seemingly broken post suspend script it was supposed to fix my external monitor not working :-( --- hosts/niks/configuration.nix | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/hosts/niks/configuration.nix b/hosts/niks/configuration.nix index fd61ce02a..bbfde38ac 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