From 05bfed5ac87cb7edcd90fbd828454a8a4af2c3a2 Mon Sep 17 00:00:00 2001 From: dusklinux Date: Thu, 2 Jul 2026 22:13:40 +0530 Subject: [PATCH 1/3] added devices to disable on sav --- .gitignore | 19 +++++++++++++++++++ func.d/30-tlp-func-rf-sw | 22 +++++++++++++++++++++- tlp.conf.in | 20 +++++++++++++++++--- 3 files changed, 57 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index f953ca1f..d1f6fde8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,25 @@ debian *.geany .idea *.log +tlp +tlp-func-base +tlp-pd +tlp-pd.service +tlp-rdw +tlp-rdw-nm +tlp-rdw-udev +tlp-rdw.rules +tlp-readconfs +tlp-rf +tlp-run-on +tlp-stat +tlp-usb-udev +tlp.conf +tlp.rules +tlp.service +tlp.upstart +tlpctl +*.patch *.patch PKGBUILD* pkg diff --git a/func.d/30-tlp-func-rf-sw b/func.d/30-tlp-func-rf-sw index 17d31328..2ddfac03 100644 --- a/func.d/30-tlp-func-rf-sw +++ b/func.d/30-tlp-func-rf-sw @@ -391,6 +391,8 @@ set_radio_device_states () { # then re-enable wifi on shutdown to prepare for startup if wordinlist "wifi" "$DEVICES_TO_DISABLE_ON_BAT $DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE + $DEVICES_TO_DISABLE_ON_SAV + $DEVICES_TO_DISABLE_ON_SAV_NOT_IN_USE $DEVICES_TO_DISABLE_ON_LAN_CONNECT $DEVICES_TO_DISABLE_ON_WIFI_CONNECT $DEVICES_TO_DISABLE_ON_WWAN_CONNECT" && \ @@ -406,7 +408,7 @@ set_radio_device_states () { devs2disable="" ;; - "$PP_BAL"|"$PP_SAV") # balanced/power-saver profile --> build disable list + "$PP_BAL") # balanced profile --> build disable list quiet=1 # do not display progress devs2enable="" devs2disable="${DEVICES_TO_DISABLE_ON_BAT:-}" @@ -424,6 +426,24 @@ set_radio_device_states () { devs2disable="${devs2disable# }" ;; + "$PP_SAV") # power-saver profile --> build disable list + quiet=1 # do not display progress + devs2enable="" + devs2disable="${DEVICES_TO_DISABLE_ON_SAV-${DEVICES_TO_DISABLE_ON_BAT:-}}" + + # check configured list for connected devices + for dev in ${DEVICES_TO_DISABLE_ON_SAV_NOT_IN_USE-${DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE:-}}; do + # if device is not connected and not in list yet --> add to disable list + { case $dev in + bluetooth) any_bluetooth_in_use ;; + nfc) any_nfc_in_use ;; + wifi) any_wifi_in_use ;; + wwan) any_wwan_in_use ;; + esac } || wordinlist "$dev" "$devs2disable" || devs2disable="$dev $devs2disable" + done + devs2disable="${devs2disable# }" + ;; + esac echo_debug "rf" "set_radio_device_states($1): enable=$devs2enable disable=$devs2disable" "$LOG_INFO" diff --git a/tlp.conf.in b/tlp.conf.in index ec3e6a80..72746ebc 100644 --- a/tlp.conf.in +++ b/tlp.conf.in @@ -558,20 +558,34 @@ #DEVICES_TO_ENABLE_ON_AC="bluetooth nfc wifi wwan" -# Radio devices to disable when switching to the balanced or power-saver -# profile: +# Radio devices to disable when switching to the balanced profile: # bluetooth, nfc, wifi, wwan. # Default: #DEVICES_TO_DISABLE_ON_BAT="bluetooth nfc wifi wwan" +# Radio devices to disable when switching to the power-saver profile: +# bluetooth, nfc, wifi, wwan. +# Falls back to DEVICES_TO_DISABLE_ON_BAT if not set. +# Default: + +#DEVICES_TO_DISABLE_ON_SAV="bluetooth nfc wifi wwan" + # Radio devices to disable when not in use (not connected) and switching -# to the balanced or power-saver profile: +# to the balanced profile: # bluetooth, nfc, wifi, wwan. # Default: #DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth nfc wifi wwan" +# Radio devices to disable when not in use (not connected) and switching +# to the power-saver profile: +# bluetooth, nfc, wifi, wwan. +# Falls back to DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE if not set. +# Default: + +#DEVICES_TO_DISABLE_ON_SAV_NOT_IN_USE="bluetooth nfc wifi wwan" + # Battery Care -- Charge thresholds # Charging will start once the charger is connected and the battery level # is below the start threshold. Charging stops when the battery level From 6c3d5548dcec169042288d5fa9b0e54acdebdf04 Mon Sep 17 00:00:00 2001 From: dusk Date: Thu, 2 Jul 2026 22:18:05 +0530 Subject: [PATCH 2/3] Revert .gitignore to state before commit 05bfed5 --- .gitignore | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.gitignore b/.gitignore index d1f6fde8..f953ca1f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,25 +3,6 @@ debian *.geany .idea *.log -tlp -tlp-func-base -tlp-pd -tlp-pd.service -tlp-rdw -tlp-rdw-nm -tlp-rdw-udev -tlp-rdw.rules -tlp-readconfs -tlp-rf -tlp-run-on -tlp-stat -tlp-usb-udev -tlp.conf -tlp.rules -tlp.service -tlp.upstart -tlpctl -*.patch *.patch PKGBUILD* pkg From e530e55ea5f0855902fca19641603038e40b42af Mon Sep 17 00:00:00 2001 From: dusklinux Date: Mon, 6 Jul 2026 22:49:34 +0530 Subject: [PATCH 3/3] Decouple balanced and power-saver radio configurations and add DEVICES_TO_ENABLE_ON_BAT/SAV --- func.d/30-tlp-func-rf-sw | 12 ++++++------ tlp.conf.in | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/func.d/30-tlp-func-rf-sw b/func.d/30-tlp-func-rf-sw index 2ddfac03..b940f7e6 100644 --- a/func.d/30-tlp-func-rf-sw +++ b/func.d/30-tlp-func-rf-sw @@ -408,9 +408,9 @@ set_radio_device_states () { devs2disable="" ;; - "$PP_BAL") # balanced profile --> build disable list + "$PP_BAL") # balanced profile --> build disable/enable lists quiet=1 # do not display progress - devs2enable="" + devs2enable="${DEVICES_TO_ENABLE_ON_BAT:-}" devs2disable="${DEVICES_TO_DISABLE_ON_BAT:-}" # check configured list for connected devices @@ -426,13 +426,13 @@ set_radio_device_states () { devs2disable="${devs2disable# }" ;; - "$PP_SAV") # power-saver profile --> build disable list + "$PP_SAV") # power-saver profile --> build disable/enable lists quiet=1 # do not display progress - devs2enable="" - devs2disable="${DEVICES_TO_DISABLE_ON_SAV-${DEVICES_TO_DISABLE_ON_BAT:-}}" + devs2enable="${DEVICES_TO_ENABLE_ON_SAV:-}" + devs2disable="${DEVICES_TO_DISABLE_ON_SAV:-}" # check configured list for connected devices - for dev in ${DEVICES_TO_DISABLE_ON_SAV_NOT_IN_USE-${DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE:-}}; do + for dev in ${DEVICES_TO_DISABLE_ON_SAV_NOT_IN_USE:-}; do # if device is not connected and not in list yet --> add to disable list { case $dev in bluetooth) any_bluetooth_in_use ;; diff --git a/tlp.conf.in b/tlp.conf.in index 72746ebc..1e53d3ef 100644 --- a/tlp.conf.in +++ b/tlp.conf.in @@ -558,6 +558,18 @@ #DEVICES_TO_ENABLE_ON_AC="bluetooth nfc wifi wwan" +# Radio devices to enable when switching to the balanced profile: +# bluetooth, nfc, wifi, wwan. +# Default: + +#DEVICES_TO_ENABLE_ON_BAT="bluetooth nfc wifi wwan" + +# Radio devices to enable when switching to the power-saver profile: +# bluetooth, nfc, wifi, wwan. +# Default: + +#DEVICES_TO_ENABLE_ON_SAV="bluetooth nfc wifi wwan" + # Radio devices to disable when switching to the balanced profile: # bluetooth, nfc, wifi, wwan. # Default: @@ -566,7 +578,6 @@ # Radio devices to disable when switching to the power-saver profile: # bluetooth, nfc, wifi, wwan. -# Falls back to DEVICES_TO_DISABLE_ON_BAT if not set. # Default: #DEVICES_TO_DISABLE_ON_SAV="bluetooth nfc wifi wwan" @@ -581,7 +592,6 @@ # Radio devices to disable when not in use (not connected) and switching # to the power-saver profile: # bluetooth, nfc, wifi, wwan. -# Falls back to DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE if not set. # Default: #DEVICES_TO_DISABLE_ON_SAV_NOT_IN_USE="bluetooth nfc wifi wwan"