diff options
| -rwxr-xr-x | .local/bin/bat-thresh-toggle | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/.local/bin/bat-thresh-toggle b/.local/bin/bat-thresh-toggle index 2819132..836698e 100755 --- a/.local/bin/bat-thresh-toggle +++ b/.local/bin/bat-thresh-toggle | |||
| @@ -20,13 +20,13 @@ writing a persistent TLP drop-in to ${TLP_DROP_IN}. | |||
| 20 | 20 | ||
| 21 | options: | 21 | options: |
| 22 | (none) toggle between travel (${TRAVEL_START}/${TRAVEL_STOP}%) and docked (${DOCKED_START}/${DOCKED_STOP}%) | 22 | (none) toggle between travel (${TRAVEL_START}/${TRAVEL_STOP}%) and docked (${DOCKED_START}/${DOCKED_STOP}%) |
| 23 | --system-default restore TLP built-in defaults (${DEFAULT_START}/${DEFAULT_STOP}%) and remove drop-in | 23 | -d restore TLP built-in defaults (${DEFAULT_START}/${DEFAULT_STOP}%) and remove drop-in |
| 24 | -h, --help show this help message and exit | 24 | -h, --help show this help message and exit |
| 25 | 25 | ||
| 26 | modes: | 26 | modes: |
| 27 | travel START_CHARGE_THRESH_BAT0=${TRAVEL_START} STOP_CHARGE_THRESH_BAT0=${TRAVEL_STOP} | 27 | travel START_CHARGE_THRESH_BAT0=${TRAVEL_START} STOP_CHARGE_THRESH_BAT0=${TRAVEL_STOP} |
| 28 | docked START_CHARGE_THRESH_BAT0=${DOCKED_START} STOP_CHARGE_THRESH_BAT0=${DOCKED_STOP} | 28 | docked START_CHARGE_THRESH_BAT0=${DOCKED_START} STOP_CHARGE_THRESH_BAT0=${DOCKED_STOP} |
| 29 | system-default START_CHARGE_THRESH_BAT0=${DEFAULT_START} STOP_CHARGE_THRESH_BAT0=${DEFAULT_STOP} | 29 | default (-d) START_CHARGE_THRESH_BAT0=${DEFAULT_START} STOP_CHARGE_THRESH_BAT0=${DEFAULT_STOP} |
| 30 | 30 | ||
| 31 | EOF | 31 | EOF |
| 32 | } | 32 | } |
| @@ -48,7 +48,7 @@ fi | |||
| 48 | [ -f "$THRESH_STOP_PATH" ] || { echo "error: $THRESH_STOP_PATH not found — is thinkpad_acpi loaded?"; exit 1; } | 48 | [ -f "$THRESH_STOP_PATH" ] || { echo "error: $THRESH_STOP_PATH not found — is thinkpad_acpi loaded?"; exit 1; } |
| 49 | 49 | ||
| 50 | # --system-default: remove drop-in and restore TLP built-in defaults (96/100) | 50 | # --system-default: remove drop-in and restore TLP built-in defaults (96/100) |
| 51 | if [ "${1}" = "--system-default" ]; then | 51 | if [ "${1}" = "-d" ]; then |
| 52 | printf "%s" "$DEFAULT_STOP" > "$THRESH_STOP_PATH" || { echo "error: failed to write stop threshold."; exit 1; } | 52 | printf "%s" "$DEFAULT_STOP" > "$THRESH_STOP_PATH" || { echo "error: failed to write stop threshold."; exit 1; } |
| 53 | printf "%s" "$DEFAULT_START" > "$THRESH_START_PATH" || { echo "error: failed to write start threshold."; exit 1; } | 53 | printf "%s" "$DEFAULT_START" > "$THRESH_START_PATH" || { echo "error: failed to write start threshold."; exit 1; } |
| 54 | echo "restored system defaults — start: ${DEFAULT_START}% stop: ${DEFAULT_STOP}%" | 54 | echo "restored system defaults — start: ${DEFAULT_START}% stop: ${DEFAULT_STOP}%" |
