1
0
Fork 0

Improve battery systemd-unit

This commit is contained in:
Malte Brandy 2019-05-27 23:35:10 +02:00
parent f70683bbd5
commit 8e188d9de7
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9

View file

@ -1,7 +1,9 @@
{ lib, pkgs, config, ... }: { lib, pkgs, config, ... }:
with lib; with lib;
let let
battery-watch = pkgs.writeShellScriptBin "battery-watch" '' battery-watch = pkgs.writeScript "battery-watch" ''
#!${pkgs.stdenv.shell}
critical_level=20 #percent critical_level=20 #percent
while true while true
@ -29,7 +31,7 @@ config = mkIf config.m-0.battery.enable {
Description = "Watch battery state and warn user"; Description = "Watch battery state and warn user";
}; };
Service = { Service = {
ExecStart="/bin/sh ${battery-watch}/bin/battery-watch"; ExecStart=toString battery-watch;
}; };
Install = { Install = {
WantedBy = [ "graphical-session.target" ]; WantedBy = [ "graphical-session.target" ];