Skip to content

Commit

Permalink
Goodbye loopCmd (replaced by one-line scripts)
Browse files Browse the repository at this point in the history
  • Loading branch information
VR-25 committed Jul 16, 2022
1 parent 2a86693 commit e778686
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 65 deletions.
12 changes: 0 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,6 @@ runCmdOnPause=''
ampFactor=
voltFactor=
loopCmd=''
prioritizeBattIdleMode=false
currentWorkaround=false
battStatusWorkaround=true
Expand Down Expand Up @@ -347,8 +345,6 @@ tempLevel=0
# voltFactor=volt_factor=MULTIPLIER NULLABLE
# loopCmd=loop_cmd='COMMAND...' NULLABLE
# prioritizeBattIdleMode=prioritize_batt_idle_mode=BOOLEAN
# currentWorkaround=current_workaround=BOOLEAN
Expand Down Expand Up @@ -411,8 +407,6 @@ tempLevel=0
# af amp_factor
# vf volt_factor
# lc loop_cmd
# pbim prioritize_batt_idle_mode
# cw current_workaround
# bsw batt_status_workaround
Expand Down Expand Up @@ -543,12 +537,6 @@ tempLevel=0
# This issue is rare, though.
# Leave these properties alone if everything is running fine.
# loop_cmd (lc) #
# This is meant for extending accd's functionality.
# It is periodically executed by the is_charging function -- which is called regularly, within the main accd loop.
# The boolean isCharging is available.
# Refer back to COMMAND EXAMPLES.
# prioritize_batt_idle_mode (pbim) #
# If enabled charging switches that support battery idle mode take precedence.
# It is only used when charging_switch is not set.
Expand Down
3 changes: 1 addition & 2 deletions install/accd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ if ! $init; then
fi

set +x
eval '${loopCmd-}'
eval '${loopCmd_-}') || :
eval '${loopCmd-}') || :

# shutdown if battery temp >= shutdown_temp
[ $(cat $temp) -lt $(( ${temperature[3]} * 10 )) ] || shutdown
Expand Down
12 changes: 0 additions & 12 deletions install/default-config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ runCmdOnPause=''
ampFactor=
voltFactor=

loopCmd=''

prioritizeBattIdleMode=false
currentWorkaround=false
battStatusWorkaround=true
Expand Down Expand Up @@ -108,8 +106,6 @@ tempLevel=0

# voltFactor=volt_factor=MULTIPLIER NULLABLE

# loopCmd=loop_cmd='COMMAND...' NULLABLE

# prioritizeBattIdleMode=prioritize_batt_idle_mode=BOOLEAN

# currentWorkaround=current_workaround=BOOLEAN
Expand Down Expand Up @@ -172,8 +168,6 @@ tempLevel=0
# af amp_factor
# vf volt_factor

# lc loop_cmd

# pbim prioritize_batt_idle_mode
# cw current_workaround
# bsw batt_status_workaround
Expand Down Expand Up @@ -304,12 +298,6 @@ tempLevel=0
# This issue is rare, though.
# Leave these properties alone if everything is running fine.

# loop_cmd (lc) #
# This is meant for extending accd's functionality.
# It is periodically executed by the is_charging function -- which is called regularly, within the main accd loop.
# The boolean isCharging is available.
# Refer back to COMMAND EXAMPLES.

# prioritize_batt_idle_mode (pbim) #
# If enabled charging switches that support battery idle mode take precedence.
# It is only used when charging_switch is not set.
Expand Down
12 changes: 4 additions & 8 deletions install/oem-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ if (set +x; . $config) > /dev/null 2>&1; then
[ $configVer -eq $defaultConfVer ] || {
if [ $configVer -lt 202207160 ]; then
rm $dataDir/logs/write.log 2>/dev/null || :
if [ $configVer -lt 202109230 ]; then
$TMPDIR/acca --set force_off=false loop_cmd=
else
$TMPDIR/acca --set force_off=false
fi
$TMPDIR/acca --set force_off=false
else
$TMPDIR/acca --set dummy=
fi
Expand All @@ -24,15 +20,15 @@ fi

# battery idle mode for OnePlus devices
! _grep '^chargingSwitch=.battery/op_disable_charge 0 1 battery/input_suspend 0 0.$' \
|| loopCmd_='[ $(cat battery/input_suspend) != 1 ] || echo 0 > battery/input_suspend'
|| loopCmd='[ $(cat battery/input_suspend) != 1 ] || echo 0 > battery/input_suspend'

# battery idle mode for Google Pixel 2/XL and devices with similar hardware
! _grep '^chargingSwitch=./sys/module/lge_battery/parameters/charge_stop_level' \
|| loopCmd_='[ $(cat battery/input_suspend) != 1 ] || echo 0 > battery/input_suspend'
|| loopCmd='[ $(cat battery/input_suspend) != 1 ] || echo 0 > battery/input_suspend'

# bttery idle mode for certain mtk devices
# ! _grep '^chargingSwitch=.battery/input_suspend 0 1 /proc/mtk_battery_cmd/en_power_path 1 1' \
# || loopCmd_='
# || loopCmd='
# if [ $(cat /proc/mtk_battery_cmd/en_power_path) -eq 0 ] && [ $(cat battery/status) = Discharging ]; then
# echo 0 > battery/input_suspend
# fi
Expand Down
2 changes: 0 additions & 2 deletions install/print-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ run_cmd_on_pause='$runCmdOnPause'
amp_factor=$ampFactor
volt_factor=$voltFactor
loop_cmd='$loopCmd'
prioritize_batt_idle_mode=$prioritizeBattIdleMode
current_workaround=$currentWorkaround
batt_status_workaround=$battStatusWorkaround
Expand Down
12 changes: 0 additions & 12 deletions install/translations/fr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,6 @@ runCmdOnPause=''
ampFactor=
voltFactor=
loopCmd=''
prioritizeBattIdleMode=false
currentWorkaround=false
battStatusWorkaround=true
Expand Down Expand Up @@ -348,8 +346,6 @@ dischargePolarity=
# voltFactor=volt_factor=[multiplier]
# loopCmd=loop_cmd='command...'
# prioritizeBattIdleMode=prioritize_batt_idle_mode=boolean
# currentWorkaround=current_workaround=boolean
Expand Down Expand Up @@ -406,8 +402,6 @@ dischargePolarity=
# af amp_factor
# vf volt_factor
# lc loop_cmd
# pbim prioritize_batt_idle_mode
# cw current_workaround
# bsw batt_status_workaround
Expand Down Expand Up @@ -535,12 +529,6 @@ dischargePolarity=
# This issue is rare, though.
# Leave these properties alone if everything is running fine.
# loop_cmd (lc) #
# This is meant for extending accd's functionality.
# It is periodically executed by the is_charging function -- which is called regularly, within the main accd loop.
# The boolean isCharging is available.
# Refer back to COMMAND EXAMPLES.
# prioritize_batt_idle_mode (pbim) #
# If enabled charging switches that support battery idle mode take precedence.
# It is only used when charging_switch is not set.
Expand Down
13 changes: 0 additions & 13 deletions install/translations/tr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,6 @@ runCmdOnPause=''
ampFactor=
voltFactor=
loopCmd=''
prioritizeBattIdleMode=false
currentWorkaround=false
battStatusWorkaround=true
Expand Down Expand Up @@ -344,8 +342,6 @@ yeniden başlatın.
# voltFactor=volt_factor=[multiplier]
# loopCmd=loop_cmd='command...'
# prioritizeBattIdleMode=prioritize_batt_idle_mode=boolean
# currentWorkaround=current_workaround=boolean
Expand Down Expand Up @@ -400,8 +396,6 @@ yeniden başlatın.
# af amp_factor
# vf volt_factor
# lc loop_cmd
# pbim prioritize_batt_idle_mode
# cw current_workaround
# bsw batt_status_workaround
Expand Down Expand Up @@ -533,13 +527,6 @@ hale getirilebilir.
# Ancak nadir bir hatadır.
# Her şey düzgün çalıyorsa bu değerler ile oynamayın.
# loop_cmd (lc) #
# accd'nin kullanılabilirliğini arttırmak amacı ile yapıldı. (bu kısmı İngilizce anlamıyorsanız sizlik bir şey söz konusu değil
geçebilirsiniz)
# It is periodically executed by the is_charging function -- which is called regularly, within the main accd loop.
# The boolean isCharging is available.
# Refer back to COMMAND EXAMPLES.
# prioritize_batt_idle_mode (pbim) #
# Eğer aktif edilirse Idle mod desteklenmesi durumunda ona öncelik verilir.
# Yalnızca charging_switch seçilmediği zaman kullanılır.
Expand Down
4 changes: 0 additions & 4 deletions install/write-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ rcp="${run_cmd_on_pause-${rcp-${runCmdOnPause[@]}}}"
af=${amp_factor-${af-$ampFactor}}
vf=${volt_factor-${vf-$voltFactor}}

lc="${loop_cmd-${lc-${loopCmd[@]}}}"

pbim=${prioritize_batt_idle_mode-${pbim-$prioritizeBattIdleMode}}

cw=${current_workaround-${cw-$currentWorkaround}}
Expand Down Expand Up @@ -116,8 +114,6 @@ runCmdOnPause='$rcp'
ampFactor=$af
voltFactor=$vf
loopCmd='$lc'
prioritizeBattIdleMode=${pbim:-false}
currentWorkaround=${cw:-false}
battStatusWorkaround=${bsw:-true}
Expand Down

0 comments on commit e778686

Please sign in to comment.