battery/ac target fixes (wip, still needs work)
This commit is contained in:
@@ -8,6 +8,20 @@
|
||||
SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="0", RUN+="/run/current-system/systemd/bin/systemctl start battery.target"
|
||||
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="/run/current-system/systemd/bin/systemctl start ac.target"
|
||||
'';
|
||||
systemd.targets = {
|
||||
"ac" = {
|
||||
description = "On AC power";
|
||||
unitConfig = {
|
||||
StopWhenUnneeded = "yes";
|
||||
};
|
||||
};
|
||||
"battery" = {
|
||||
description = "On battery power";
|
||||
unitConfig = {
|
||||
StopWhenUnneeded = "yes";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user