-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConstants.cs
24 lines (20 loc) · 939 Bytes
/
Constants.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
namespace batman;
public static class Constants
{
public const string BAT_CHARGE_END_THRESHOLD_FILE = "/sys/class/power_supply/BAT0/charge_control_end_threshold";
public const string BAT_END_THRESHOLD_CONFIG_FILE = "/etc/max_charge";
public const string SERVICE_FILE = "/etc/systemd/system/batman.service";
public const string SERVICE_FILE_CONTENT =
"""
[Unit]
Description=Set the battery charge threshold
After=multi-user.target suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target
StartLimitBurst=0
[Service]
Type=oneshot
Restart=on-failure
ExecStart=/bin/bash -c 'cat /etc/max_charge > /sys/class/power_supply/BAT0/charge_control_end_threshold'
[Install]
WantedBy=multi-user.target suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target
""";
}