This commit is contained in:
Steph 2022-10-24 13:34:49 +02:00
parent 5e6bf35747
commit 7406df9cf8
2 changed files with 32 additions and 0 deletions

View File

@ -130,6 +130,7 @@
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
set-backlight-script
neovim
git
wget
@ -335,4 +336,29 @@ $NEW_PROMPT_COMMAND"
};
let set-backlight-script = (writeShellApplication {
name = "set-backlight-script";
text = ''
#!/bin/sh
for d in /sys/class/backlight/*; do
cd $d
echo $(( $(cat max_brightness) / 2)) > brightness
done
'';
});
in
systemd.services.99setbacklight = {
enable = true;
description = "bar";
unitConfig = {
Type = "simple";
};
serviceConfig = {
ExecStart = "${set-backlight-script}";
};
wantedBy = [ "multi-user.target" ];
};
}

6
startup.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
for dev in /sys/class/backlight/* ; do
cd $dev
echo $(( $(cat max_brightness) / 2)) > brightness
done