From 1270b2e209bc002e69bbe6351ad5b04b7facfcc8 Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Sun, 29 Dec 2019 14:32:28 +0000 Subject: [PATCH] Temporary solution for automatic resolution updates Resolves #2 --- nix/base.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/nix/base.nix b/nix/base.nix index 4fd8d7f..801c1c7 100644 --- a/nix/base.nix +++ b/nix/base.nix @@ -69,4 +69,19 @@ startup = do }; wantedBy = [ "sysinit.target" ]; }; + + systemd.user.services."xrandr" = { + script = "${pkgs.xorg.xrandr}/bin/xrandr --output Virtual-1 --mode $(${pkgs.xorg.xrandr}/bin/xrandr | grep ' ' | head -n 2 | tail -n 1 | ${pkgs.gawk}/bin/awk '{ print $1 }')"; + }; + + systemd.user.timers."xrandr" = { + description = "Auto update resolution crutch"; + timerConfig = { + OnBootSec = "1s"; + OnUnitInactiveSec = "1s"; + Unit = "xrandr.service"; + AccuracySec = "1us"; + }; + wantedBy = ["timers.target"]; + }; }