From e77868631af38cba34e80d78ae1dd5bf634e27d5 Mon Sep 17 00:00:00 2001 From: VR-25 <28943176+VR-25@users.noreply.github.com> Date: Sat, 16 Jul 2022 13:28:14 +0100 Subject: [PATCH] Goodbye loopCmd (replaced by one-line scripts) --- README.md | 12 ------------ install/accd.sh | 3 +-- install/default-config.txt | 12 ------------ install/oem-custom.sh | 12 ++++-------- install/print-config.sh | 2 -- install/translations/fr/README.md | 12 ------------ install/translations/tr/README.md | 13 ------------- install/write-config.sh | 4 ---- 8 files changed, 5 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index 86cd34c..4bd56b8 100644 --- a/README.md +++ b/README.md @@ -266,8 +266,6 @@ runCmdOnPause='' ampFactor= voltFactor= -loopCmd='' - prioritizeBattIdleMode=false currentWorkaround=false battStatusWorkaround=true @@ -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 @@ -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 @@ -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. diff --git a/install/accd.sh b/install/accd.sh index 5d131ad..815ad48 100644 --- a/install/accd.sh +++ b/install/accd.sh @@ -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 diff --git a/install/default-config.txt b/install/default-config.txt index 521aa47..a14da3c 100644 --- a/install/default-config.txt +++ b/install/default-config.txt @@ -27,8 +27,6 @@ runCmdOnPause='' ampFactor= voltFactor= -loopCmd='' - prioritizeBattIdleMode=false currentWorkaround=false battStatusWorkaround=true @@ -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 @@ -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 @@ -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. diff --git a/install/oem-custom.sh b/install/oem-custom.sh index 95dd53a..0e9ef5e 100644 --- a/install/oem-custom.sh +++ b/install/oem-custom.sh @@ -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 @@ -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 diff --git a/install/print-config.sh b/install/print-config.sh index 1d72074..5994e43 100644 --- a/install/print-config.sh +++ b/install/print-config.sh @@ -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 diff --git a/install/translations/fr/README.md b/install/translations/fr/README.md index fd410a6..45c0c97 100644 --- a/install/translations/fr/README.md +++ b/install/translations/fr/README.md @@ -265,8 +265,6 @@ runCmdOnPause='' ampFactor= voltFactor= -loopCmd='' - prioritizeBattIdleMode=false currentWorkaround=false battStatusWorkaround=true @@ -348,8 +346,6 @@ dischargePolarity= # voltFactor=volt_factor=[multiplier] -# loopCmd=loop_cmd='command...' - # prioritizeBattIdleMode=prioritize_batt_idle_mode=boolean # currentWorkaround=current_workaround=boolean @@ -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 @@ -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. diff --git a/install/translations/tr/README.md b/install/translations/tr/README.md index bb16a37..1b99294 100644 --- a/install/translations/tr/README.md +++ b/install/translations/tr/README.md @@ -262,8 +262,6 @@ runCmdOnPause='' ampFactor= voltFactor= -loopCmd='' - prioritizeBattIdleMode=false currentWorkaround=false battStatusWorkaround=true @@ -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 @@ -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 @@ -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. diff --git a/install/write-config.sh b/install/write-config.sh index 87d6da9..808182e 100644 --- a/install/write-config.sh +++ b/install/write-config.sh @@ -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}} @@ -116,8 +114,6 @@ runCmdOnPause='$rcp' ampFactor=$af voltFactor=$vf -loopCmd='$lc' - prioritizeBattIdleMode=${pbim:-false} currentWorkaround=${cw:-false} battStatusWorkaround=${bsw:-true}