Turn monitor off when suspending or shutdown after 9pm

This commit is contained in:
Henry Hiles 2024-12-24 12:35:43 -05:00
parent 04e890ce58
commit 6e5b414ec8
4 changed files with 46 additions and 30 deletions

View file

@ -1,5 +1,4 @@
{pkgs, ...}: {
hardware.i2c.enable = true;
environment.systemPackages = with pkgs.gnomeExtensions; [
caffeine
open-bar

View file

@ -0,0 +1,17 @@
{
pkgs,
lib,
...
}: {
hardware.i2c.enable = true;
systemd.services.monitor = {
script = "if [[ $(${pkgs.coreutils}/bin/date +%H) -ge 20 ]]; then ${lib.meta.getExe pkgs.ddcutil} setvcp D6 05; fi";
wantedBy = ["suspend.target" "shutdown.target"];
before = ["suspend.target" "shutdown.target"];
serviceConfig = {
StopWhenUnneeded = true;
Type = "oneshot";
};
};
}

View file

@ -13,7 +13,6 @@
heroic
aspell
muzika
ddcutil
fractal
killall
ripgrep
@ -29,6 +28,7 @@
protontricks
prismlauncher
android-studio
nexusmods-app-unfree
nodePackages_latest.pnpm
hunspellDicts.en_CA-large
inputs.nix-gaming.packages.${system}.wine-ge