Turn monitor off when suspending or shutdown after 9pm
This commit is contained in:
parent
04e890ce58
commit
6e5b414ec8
4 changed files with 46 additions and 30 deletions
|
@ -1,5 +1,4 @@
|
|||
{pkgs, ...}: {
|
||||
hardware.i2c.enable = true;
|
||||
environment.systemPackages = with pkgs.gnomeExtensions; [
|
||||
caffeine
|
||||
open-bar
|
||||
|
|
17
modules/common-desktop/monitor.nix
Normal file
17
modules/common-desktop/monitor.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue