configVerCode=202505180

allowIdleAbovePcap=true
ampFactor=
battStatusWorkaround=true
capacity=(5 101 70 75 false)
cooldownCurrent=
cooldownRatio=()
currentWorkaround=false
forceOff=false
language=en
offMid=true
prioritizeBattIdleMode=true
rebootResume=false
resetBattStats=(false false false)
temperature=(45 50 40 55)
tempLevel=0
voltFactor=

applyOnBoot=()

applyOnPlug=()

battStatusOverride=''

chargingSwitch=()

idleApps=()

maxChargingCurrent=()

maxChargingVoltage=()

runCmdOnPause=''



# SYNTAX

# allowIdleAbovePcap=true|false
# ampFactor=1000|1000000
# applyOnBoot=([CTRL_FILE1::RAW_VALUE[::DEFAULT]] [CTRL_FILE2::RAW_VALUE[::DEFAULT]...] [--exit])
# applyOnPlug=([CTRL_FILE1::RAW_VALUE[::DEFAULT]] [CTRL_FILE2::RAW_VALUE[::DEFAULT]...])
# battStatusOverride=Idle|Discharging|'code to PRINT value for _status'
# battStatusWorkaround=true|false
# capacity=(shutdown_capacity=% cooldown_capacity=% resume_capacity=% pause_capacity=% capacity_mask=true|false)
# chargingSwitch=([CTRL_FILE1 ON OFF [CTRL_FILE2 ON OFF...] [--]])
# cooldownCurrent=mA|mA%
# cooldownRatio=(cooldown_charge=seconds cooldown_pause=seconds)
# currentWorkaround=true|false
# forceOff=true|false
# idleApps=(comma or space-separated patterns matching Android package names)
# language=LANGUAGE_CODE
# maxChargingCurrent=(MILLIAMPS [CTRL_FILE1::RAW_VALUE::DEFAULT CTRL_FILE2::RAW_VALUE::DEFAULT...])
# maxChargingVoltage=(MILLIVOLTS [CTRL_FILE1::RAW_VALUE::DEFAULT CTRL_FILE2::RAW_VALUE::DEFAULT...] [--exit])
# offMid=true|false
# prioritizeBattIdleMode=true|false|no
# rebootResume=true|false
# resetBattStats=(reset_batt_stats_on_pause=true|false reset_batt_stats_on_unplug=true|false reset_batt_stats_on_plug=true|false)
# runCmdOnPause='COMMAND...'
# temperature=(cooldown_temp=ºC max_temp=ºC resume_temp=ºC shutdown_temp=ºC)
# tempLevel=%
# voltFactor=1000|1000000



# NOTES

# Do not edit this in Windows Notepad, ever!
# It replaces LF (Linux/Unix) with CRLF (Windows) line endings.

# Nullifying values that should not be null causes unexpected behavior.
# However, doing it with "--set var=" restores the default value of "var".
# In other words, for regular users, "--set" is safer than modifying the config file directly.

# Do not feel like you must configure everything!
# Do not change what you don't understand.

# The daemon does not have to be restarted to apply changes. It picks them up automatically within seconds.



# INTERNAL FUNCTIONS

# at HH:MM command1, commmand2...   scheduler
# e.g.,
#   at 2:14 acc --notif 2:14 AM now\!
#   at 22:30 acc -n 22:30 now\!

# batt_cap   print battery level

# calc <operation...>   float  calculator

# set_temp_level <0-100>   refer to temp_level (tl) below

# voltage_now   prints the instantaneous charging voltage



# INTERNAL VARIABLES

# $_DPOL  discharge polarity (+|-)
# $_status   Charging|Discharging|Idle
# $_STI   switch test iterations (default: 35)
# $batt   expands to the /sys/class/power_supply/battery (or equivalent) directory
# $battCapacity   $batt/capacity file
# $battStatus   $batt/status file
# $currFile   current_now file
# $idleThreshold   mA absolute value to consider charging status=Idle (default: 10)
# $temp   temperature reporting file
# ${isAccd:-false}   true|false (whether accd in running)



# The "date" command
# $(date +FORMAT)
# FORMAT specifies display format string using strftime(3) syntax:

# %% literal %             %n newline              %t tab
# %S seconds (00-60)       %M minute (00-59)       %m month (01-12)
# %H hour (0-23)           %I hour (01-12)         %p AM/PM
# %y short year (00-99)    %Y year                 %C century
# %a short weekday name    %A weekday name         %u day of week (1-7, 1=mon)
# %b short month name      %B month name           %Z timezone name
# %j day of year (001-366) %d day of month (01-31) %e day of month ( 1-31)
# %N nanosec (output only)

# %U Week of year (0-53 start sunday)   %W Week of year (0-53 start monday)
# %V Week of year (1-53 start monday, week < 4 days not part of this year)

# %F "%Y-%m-%d"     %R "%H:%M"        %T "%H:%M:%S"    %z numeric timezone
# %D "%m/%d/%y"     %r "%I:%M:%S %p"  %h "%b"          %s unix epoch time
# %x locale date    %X locale time    %c locale date/time



# ALIASES (for use with --set only)

# allow_idle_above_pcap aiapc
# amp_factor af
# apply_on_boot ab
# apply_on_plug ap
# batt_status_override bso
# batt_status_workaround bsw
# capacity_mask cm
# charging_switch s
# cooldown_capacity cc
# cooldown_charge cch
# cooldown_current cdc
# cooldown_pause cp
# cooldown_temp ct
# current_workaround cw
# force_off fo
# idle_apps ia
# lang l
# max_charging_current mcc
# max_charging_voltage mcv
# max_temp mt
# resume_temp rt
# off_mid om
# pause_capacity pc
# prioritize_batt_idle_mode pbim
# reboot_resume rr
# reset_batt_stats_on_pause rbsp
# reset_batt_stats_on_plug rbspl
# reset_batt_stats_on_unplug rbsu
# resume_capacity rc
# run_cmd_on_pause rcp
# shutdown_capacity sc
# shutdown_temp st
# temp_level tl
# volt_factor vf



# FINE, BUT WHAT DOES EACH OF THESE VARIABLES ACTUALLY MEAN?


# configVerCode #
# This is checked during updates to determine whether the config should be patched. Do NOT modify.
# The value is not necessarily the same as acc's version code.


# allow_idle_above_pcap (aiapc) #
#
# Type: Boolean
# Default: true
#
# If set to false, accd will avoid idle mode (if possible) when capacity > pause_capacity.
# This is useful for forever-plugged setups, where battery longevity is a top priority.
# Idle mode is good, but "storing" a highly charged battery for a LONG time is a bad idea.
# The recommended capacity range for long-term/forever-plugged is 40-60%.


# amp_factor (af) # volt_factor (vf) #
#
# Type: Integer (usually 1000000 or 1000)
# Defaults: Null
#
# Unit multiplier for conversion (e.g., 1V = 1000000uV, 1A = 1000000mA).
# ACC can automatically determine the units, but the mechanism is not 100% foolproof.
# Leave those properties alone, unless acc -i misreports current/voltage values.


# apply_on_boot (ab) # apply_on_plug (ap) #
#
# Type: String (CTRL_FILE1::VALUE::DEFAULT CTRL_FILE2::VALUE::DEFAULT... --exit)
# Default: Null
#
# e.g., acc -s ab=wireless/voltage_max::9000000 (forces fast wireless charging on Pixel devices)
#
# This is for general kernel tweaking.
# For ab, settings are applied on boot and on daemon start/restart.
# For ap, settings are applied periodically, while charging.
#
# Default values (optional) are restored when the daemon stops.
# "--exit" (for ab only) instructs accd to stop after applying settings.


# batt_status_override (bso) #
#
# Type: String (Idle|Discharging|'code to PRINT value for _status')
# Default: Null
#
# Overrides the battery status determined by the not_charging function.
# It can be Idle, Discharging (both case sensitive), or a script to PRINT the desired value for the _status variable.
# When it's Idle or Discharging, _status will be set to that value if the charging switch state is off.
# This only works in conjunction with an enforced charging switch (set manually, has a trailing " --").
#
# Usage scenario: the switch "main/cool_mode 0 1" supports idle mode. However, sometimes it doesn't respond soon enough (e.g., due to fast charging).
# The user can then enforce it with "acc -ss" and set "batt_status_override=Idle".
# This means, when "main/cool_mode" is "on" (0), _status will be determined by the not_charging function (as usual), but when it's off (1), _status will be Idle, overriding the not_charging function's logic.
#
# If the user were to write their own logic, it would be something like the following:
# batt_status_override='[ $(cat main/cool_mode) -eq 1 ] && printf Idle || :'
# The "|| :" part is mandatory to avoid issues with "set -e", which acc uses extensively.


# batt_status_workaround (bsw) #
#
# Type: Boolean
# Default: true
#
# With this enabled (true), in addition to just reading POWER_SUPPLY_STATUS, if the battery is "Charging" and current is within 40mA (inclusive), battery status is considered "Idle".
# Status is considered "Discharging", if the current's polarity changes after calling the disable_charging function.
# By not relying solely on the information provided by POWER_SUPPLY_STATUS, this approach dramatically boosts compatibility.
# This must be disabled on systems that report wrong/misleading charging current values.


# capacity_mask (cm) #
#
# Type: Boolean
# Default: false
#
# This forces Android to report "capacity = (capacity - shutdown _capacity) * 100 / (pause_capacity - shutdown_capacity)", effectively masking capacity limits.
# It also prevents Android from getting capacity readings below 2%, since some systems shutdown before battery level actually drops to 0%.
# Use case: Secretly install acc on a relative's device, and enable this, so that they always see the regular 0-100% battery level scale.


# charging_switch (s) #
#
# Type: String (CTRL_FILE1 ON OFF CTRL_FILE2 ON OFF... --)
# Default: Null (automatic)
#
# If unset, acc cycles through its database and sets the first switch/group that successfully disables charging.
# If later, the set switch/group fails 3 times in a row, acc unsets it, moves it to the end of the list and repeats the above.
# If all switches fail to disable charging, chargingSwitch is unset and acc/d exit with code 7.
#
# This automated process can be disabled by appending " --" to the switch/group.
# e.g., acc -s s="battery/charging_enabled 1 0 --"
# "acc -ss" always appends " --".
#
# Certain switches tend to be problematic/unreliable under specific condition (e.g., screen off, fast charging, heavy load).
# Sometimes, this is caused by rogue thermal management programs (e.g., mi_thermald).
# To mitigate this, one may want to try force_off or a thermal mod.


# cooldown_capacity (cc) #
#
# Type: Integer (percentage)
# Default: 101
#
# Battery level or millivolts at which the cooldown cycle starts.
# Cooldown reduces battery stress induced by prolonged exposure to high temperature and high charging voltage.
# It does so through periodically pausing charging for a few seconds (cooldown_pause, more details below).
# Requires cooldown_current OR "cooldown_charge and cooldown_pause".


# cooldown_charge (cch) # cooldown_pause (cp) #
#
# Type: Integer (seconds)
# Defaults: null
#
# Those dictate the cooldown cycle intervals (seconds).
# When not set, the cycle is disabled.
# Suggested values are cch=50 and cp=10.
# If charging gets slower than desired, try cch=50 and cp=5.
# Note that cooldown_capacity and cooldown_temp can be disabled individually by assigning them values that would never be reached under normal circumstances.
# cooldown_current optionally works with ratios as well (cooldown_charge: regular current, cooldown_pause: cooldown_current).


# cooldown_current (cdc) #
#
# Type: Integer (milliamps)
# Default: Null
#
# Instead of pausing charging for cooldown_pause seconds, limit the max charging current (e.g., to 500 (mA) or even 50% (of the max current).
# cooldown_pause and cooldown_charge are optional.
# When the value is a percentage, temp_level is used as back-end, rather than the regular current control logic.


# cooldown_temp (ct) #
#
# Type: Integer (°C)
# Default: 45
#
# Temperature (°C) at which the cooldown cycle starts.
# Cooldown reduces the battery degradation rate by lowering the device's temperature.
# Requires cooldown_current OR "cooldown_charge and cooldown_pause".


# current_workaround (cw) #
#
# Type: Boolean
# Default: false
#
# If set to true, acc only uses current control files whose paths match "batt".
# This is necessary only if the current limit affects both input and charging current values.
# Enable if low current values don't work.


# force_off (fo) #
#
# Type: Boolean
# Default: false
#
# Enable this only as last resort, if the set charging switch is stubbornly reset by the system.
# Oftentimes, userspace thermal management daemons (e.g., mi_thermald) and/or driver bugs are behind charging control issues.


# idle_apps (ia) #
#
# Type: String
# Default: Null
#
# This is a list of comma or space-separated patterns matching Android package names.
# When a matched app is running in the foreground, acc daemon enables idle mode.
# e.g., acc -s ia=maps,codm,pokemon


# lang (l) #
#
# Type: String
# Default: en
#
# Display language, when null, English (en) is assumed.
# WARNING: Current translations are poor/outdated.


# max_charging_current (mcc) # max_charging_voltage (mcv) #
#
# Type: Integer (milliamps/millivolts)
# Defaults: Null
#
# Control files are automatically added by accd when the array has just one element (the milliamps/millivolts value).
# If the second element of the array (array[1]) starts with "-", accd recognizes it as an instruction to update the control files.
# This is useful for setting/changing current and voltage limits without a frontend (--set or app).
# Simply put, if the user has the following in their config, accd automatically adds/updates the control files:
#   maxChargingCurrent=(1000) # Control files will be added.
#   maxChargingVoltage=(4000 -battery/voltage_max bms/voltage_max) # Control files will be updated. The "-" is mandatory after changing the value (first element). Otherwise, the change has no effect.
#
# Notes: The maximum current that can be set via dedicated commands is 9999 mA. For voltage, the max is 4300 mV. One can override those by editing the config directly. When the charging current value is a percentage, temp_level is used as back-end, rather than the regular current control logic.


# max_temp (mt) # resume_temp (rt) #
#
# Type: Integer (°C)
# Defaults: mt=50, rt=40
#
# Those two work together and are NOT tied to the cooldown cycle.
# At max_temp, charging is paused.
# If charging is paused due to capacity >= pause_capacity, it resumes when capacity <= resume_capacity AND temp <= max_temp.
# If charging is paused due to temp >= max_temp, it resumes when capacity < pause_capacity AND temp <= resume_temp


# off_mid (om) #
#
# Type: Boolean
# Default: true
#
# Whether to turn off charging after rebooting the system or restarting accd, if capacity is within resume_capacity and pause_capacity.


# one-line scripts #
#
# Type: String
# Default: Null
#
# Every line that begins with ":" is interpreted as a shell script.
# This feature can be useful for many things, including setting up persistent config profiles (i.e., source a file that overrides the main config).
# All script lines are executed whenever the config is loaded/sourced.
# This happens regularly while the daemon is running, and at least once per command run.
#
# Note: Due to user data encryption, files used in one-line scripts must reside somewhere in /data/adb/, just like acc's own data files.
# Ignore if your data isn't encrypted.
#
# Tip: One can schedule tasks with the following construct:
# : sleep profile; at 22:00 acc -s pc=50 mcc=500 mcv=3900, acc -n Switched to night profile
#
# WARNING: All scripts must always return zero. Appending "|| :" ensures that.


# pause_capacity (pc) # resume_capacity (rc) #
#
# Type: Integer (percentage)
# Defaults: pc=75, rc=70
#
# Battery level or millivolts at which charging shall be paused/resumed.


# prioritize_batt_idle_mode (pbim) #
#
# Type: Boolean | String (pbim=no)
# Default: true
#
# Battery idle mode, also called "standby mode" or "charging bypass", is the ability of running off the charger, as if the battery were disconnected from the device.
# Not all devices support this, but there's also emulated idle mode (refer to the readme), which works on all devices.
#
# If enabled, charging switches that support battery idle mode take precedence.
# This is only relevant when the switch is automatically determined -- i.e., charging_switch is not set or it has no trailing " --".
# In other words, this variable is only used when acc is automatically testing charging switches.
# When set to "no", it has the opposite effect (prioritize non-idle mode).


# reboot_resume (rr) #
#
# Type: Boolean
# Default: false
#
# Reboot (when capacity capacity is at or below resume_capacity) to re-enable charging.
# This is only for devices whose switches can't re-enable charging.
# A warning Android notification is posted 60 seconds prior, for the user to block the action, if they so please.


# reset_batt_stats_on_pause (rbsp) # reset_batt_stats_on_plug (rbspl) # reset_batt_stats_on_unplug (rbsu) #
#
# Type: Boolean
# Default: false
#
# Reset battery stats after a given event.


# run_cmd_on_pause (rcp) #
#
# Type: String
# Default: Null
#
# Run commands* after pausing charging.
# * Usually a script ("sh some_file" or ". some_file")


# shutdown_capacity (sc) #
#
# Type: Integer (percentage)
# Default: 5
#
# When the battery is discharging, its level/millivolts is at or below shutdown_capacity, and the device has been running for 15 minutes or more, acc daemon turns the device off to reduce the discharge rate, and protect the battery from potential damage, induced by voltage below the operating range.
# A value less than 1 disables it.
# An Android warning notification is posted shortly before the shutdown, giving some time to abort the process.


# shutdown_temp (st) #
#
# Type: Integer (°C)
# Default: 55
#
# Shutdown the system if battery temperature >= this value.


# temp_level (tl) #
#
# Type: Integer (percentage)
# Default: 0
#
# This is an alternate current limiting feature.
# Some devices have adjustable "temperature levels" and/or charge_control_limit, siop_level parameters.
# At the highest level, charging current is blocked.
# The stock values are generally integers, ranging from 0 to 6, 7 or so. siop_level (Samsung) ranges from 0 to 100).
# For greater flexibility, this variable stores a percentage value, which is internally mapped to the system's scales.
# Tip: If mcc is ignored under high temperature, but you still want it forced, try setting tl=1.
