update suspend scripts

This commit is contained in:
Cyryl Płotnicki 2021-11-12 22:36:04 +00:00
parent 07aec27826
commit d1f89a624a
3 changed files with 17 additions and 9 deletions

View file

@ -83,6 +83,11 @@
extraBackends = with pkgs; [ samsung-unified-linux-driver ]; extraBackends = with pkgs; [ samsung-unified-linux-driver ];
}; };
powerManagement.enable = (lib.mkForce true); powerManagement = {
powerManagement.powertop.enable = true; enable = (lib.mkForce true);
resumeCommands = ''
${pkgs.autorandr}/bin/autorandr -c
'';
powertop.enable = true;
};
} }

View file

@ -8,14 +8,14 @@
"change-dpi" = '' "change-dpi" = ''
case "$AUTORANDR_CURRENT_PROFILE" in case "$AUTORANDR_CURRENT_PROFILE" in
foureighty-docked) foureighty-docked)
DPI=144 DPI=144
;; ;;
foureighty) foureighty)
DPI=144 DPI=144
;; ;;
*) *)
echo "Unknown profle: $AUTORANDR_CURRENT_PROFILE" echo "Unknown profle: $AUTORANDR_CURRENT_PROFILE"
exit 1 exit 1
esac esac
echo "changing DPI to $DPI" echo "changing DPI to $DPI"
${pkgs.xorg.xrandr}/bin/xrandr --dpi $DPI ${pkgs.xorg.xrandr}/bin/xrandr --dpi $DPI

View file

@ -15,7 +15,10 @@
} }
{ {
delay = 600; delay = 600;
command = "xrandr --output \"$PRIMARY_DISPLAY\" --brightness 1; systemctl suspend"; command = "${pkgs.writeShellScript "my-script" ''
xrandr --output "$PRIMARY_DISPLAY" --brightness 1
systemctl suspend
''}";
} }
]; ];