summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkj_sh604 <43.splash@gmail.com>2026-02-19 23:18:52 -0500
committerkj_sh604 <43.splash@gmail.com>2026-02-19 23:18:52 -0500
commita7caf7d946b9c5c9c3453e42b5b7c69dcca54a86 (patch)
tree0502350d6ac2fc41d274ba9d788e75dc9049bf68
parentb8fd9cd0dc73f28c3b4f7e0faf6c5568550e404d (diff)
refactor: do `-d` instead of `--system-default`
-rwxr-xr-x.local/bin/bat-thresh-toggle10
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}.
options:
(none) toggle between travel (${TRAVEL_START}/${TRAVEL_STOP}%) and docked (${DOCKED_START}/${DOCKED_STOP}%)
- --system-default restore TLP built-in defaults (${DEFAULT_START}/${DEFAULT_STOP}%) and remove drop-in
+ -d restore TLP built-in defaults (${DEFAULT_START}/${DEFAULT_STOP}%) and remove drop-in
-h, --help show this help message and exit
modes:
- travel START_CHARGE_THRESH_BAT0=${TRAVEL_START} STOP_CHARGE_THRESH_BAT0=${TRAVEL_STOP}
- docked START_CHARGE_THRESH_BAT0=${DOCKED_START} STOP_CHARGE_THRESH_BAT0=${DOCKED_STOP}
- system-default START_CHARGE_THRESH_BAT0=${DEFAULT_START} STOP_CHARGE_THRESH_BAT0=${DEFAULT_STOP}
+ travel START_CHARGE_THRESH_BAT0=${TRAVEL_START} STOP_CHARGE_THRESH_BAT0=${TRAVEL_STOP}
+ docked START_CHARGE_THRESH_BAT0=${DOCKED_START} STOP_CHARGE_THRESH_BAT0=${DOCKED_STOP}
+ default (-d) START_CHARGE_THRESH_BAT0=${DEFAULT_START} STOP_CHARGE_THRESH_BAT0=${DEFAULT_STOP}
EOF
}
@@ -48,7 +48,7 @@ fi
[ -f "$THRESH_STOP_PATH" ] || { echo "error: $THRESH_STOP_PATH not found — is thinkpad_acpi loaded?"; exit 1; }
# --system-default: remove drop-in and restore TLP built-in defaults (96/100)
-if [ "${1}" = "--system-default" ]; then
+if [ "${1}" = "-d" ]; then
printf "%s" "$DEFAULT_STOP" > "$THRESH_STOP_PATH" || { echo "error: failed to write stop threshold."; exit 1; }
printf "%s" "$DEFAULT_START" > "$THRESH_START_PATH" || { echo "error: failed to write start threshold."; exit 1; }
echo "restored system defaults — start: ${DEFAULT_START}% stop: ${DEFAULT_STOP}%"