summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2017-10-25 12:42:10 +0200
committerAlan Pearce2017-10-25 12:42:10 +0200
commit43f89c30d09beac4b7dee577dd6bb55f6986eb19 (patch)
tree965b4bdbc17390c1568d9e38b43d72bfd74254d9
parent405a26ad786e511ec16fe892b6f43ac64aebf449 (diff)
downloadnixos-configuration-43f89c30d09beac4b7dee577dd6bb55f6986eb19.tar.lz
nixos-configuration-43f89c30d09beac4b7dee577dd6bb55f6986eb19.tar.zst
nixos-configuration-43f89c30d09beac4b7dee577dd6bb55f6986eb19.zip
Laptop: Enable autorandr via module
-rw-r--r--modules/hardware/laptop.nix28
1 files changed, 2 insertions, 26 deletions
diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix
index a09b12d..3024dae 100644
--- a/modules/hardware/laptop.nix
+++ b/modules/hardware/laptop.nix
@@ -18,30 +18,10 @@
     disper
   ];
 
-  # powerManagement.resumeCommands = ''
-  #   AUTORANDR="autorandr -c"
-
-  #   detect_display()
-  #   {
-  #     for X in /tmp/.X11-unix/X*; do
-  #       D="''${X##/tmp/.X11-unix/X}"
-  #       user=$(who | awk -vD="$D" '$5 ~ "\\(:"D"\\)$" {print $1}')
-  #       if [ x"$user" != x"" ]; then
-  #         export DISPLAY=":$D"
-  #         /bin/su -c "''${AUTORANDR}" "$user"
-  #       fi
-  #     done
-  #   }
-
-  #   case "$1" in
-  #     thaw|resume)
-  #       detect_display
-  #       ;;
-  #   esac
-  # '';
-
   programs.light.enable = true;
 
+  services.autorandr.enable = true;
+
   services.logind.extraConfig = ''
     IdleAction=suspend
     IdleActionSec=600
@@ -56,10 +36,6 @@
     '';
   };
 
-  services.udev.extraRules = ''
-    # ACTION=="change", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/alan/.Xauthority", RUN+="${pkgs.autorandr}/bin/autorandr -c"
-  '';
-
   services.xserver = {
     libinput = {
       enable = lib.mkDefault true;