Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions func.d/30-tlp-func-rf-sw
Original file line number Diff line number Diff line change
Expand Up @@ -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" && \
Expand All @@ -406,9 +408,9 @@ set_radio_device_states () {
devs2disable=""
;;

"$PP_BAL"|"$PP_SAV") # balanced/power-saver 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
Expand All @@ -424,6 +426,24 @@ set_radio_device_states () {
devs2disable="${devs2disable# }"
;;

"$PP_SAV") # power-saver profile --> build disable/enable lists
quiet=1 # do not display progress
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:-}; 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"
Expand Down
30 changes: 27 additions & 3 deletions tlp.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -558,20 +558,44 @@

#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 enable when switching to the balanced profile:
# bluetooth, nfc, wifi, wwan.
# Default: <none>

#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: <none>

#DEVICES_TO_ENABLE_ON_SAV="bluetooth nfc wifi wwan"

# Radio devices to disable when switching to the balanced profile:
# bluetooth, nfc, wifi, wwan.
# Default: <none>

#DEVICES_TO_DISABLE_ON_BAT="bluetooth nfc wifi wwan"

# Radio devices to disable when switching to the power-saver profile:
# bluetooth, nfc, wifi, wwan.
# Default: <none>

#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: <none>

#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.
# Default: <none>

#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
Expand Down