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"]; + }; }