Closed kai-tub closed 3 months ago
Hi,
it's not that your suggestion is new or that I haven't thought about it several times. In the end, however, the problem is always that a complete additional profile - in addition to AC and BAT - bloats the configuration and makes it more confusing.
This is even more true for your suggestion to introduce separate files for each profile. If only because all parameter names would have to be changed to those that do not contain a profile name. This would indeed break interfaces - namely to various tools based on TLP. Additional complexity would come from the need for backwards compatibility with old configurations.
I don't have the slightest desire to build all these case distinctions into the code, test them for every release, and include them in the documentation. By the way, no user would want to read that either.
Multiple profiles are a case for a GUI tool, not a "command-line with config files" tool.
TL;DR: You are grossly underestimating the effort. Take a much closer look at TLP's code before making such sweeping suggestions.
Hey, first of all, thank you for the awesome project! :heart:
Is your feature request related to a problem? Please describe.
When I unplug my fully charged laptop, I would prefer to set the different power-saving features not as aggressively as I would whenever my charge goes below 50%.
I understand that I could set the profile to
AC
manually. Looking at theCPU_X
related features, I would target something more likepower_balance
first on the battery and then switch topower
when I am below a different battery threshold. Or I would like to manually choose between differentBAT
profiles to select the desired profile depending on why I am on BAT, like showing a graphical demo or writing some docs while on a long train ride.Only having the AC and BAT profiles does not cover these use cases.
Describe the solution you'd like
Ideally, I would like support for multiple battery (maybe also AC ?) profiles. I would like to be able to switch between them manually (for example, be able to have a
low-power
mode when I am on the go and anormal
mode when I am running around in the office) and also switch the profiles whenever the battery reaches a certain threshold.But I don't think that it is necessary to have TLP automatically switch the profiles depending on the charge level in the beginning, as this could be managed by a Upower based dbus script or udev rule for laptops that trigger discharge events. This could be a follow-up feature.
I took a quick look at the architecture section, and it mentions that:
So I am unsure if this multi-profile support makes any sense with TLP's design philosophy.
But here is how one could implement it: I am not suggesting
XXX_BAT_PROFILE_N
, but rather a list of config files only read if the current profile is selected. So one would have the default configuration under/etc/tlp.conf
and then another file for each profile, like/etc/tlp_low_power
, which is only read if the profile is selected (low_power
). These settings would overwrite the ones from the default profile, allowing one to make minimal changes.To trigger the change manually, I would call
tlp bat <profile_name>
.This would have the following benefits:
tlp.conf
configuration.A potential issue might be that it might have unintended consequences if I only set a
BAT
variable in thelow-power
profile and forget to set theAC
variable in thetlp.conf
, implying that this value might impact theAC
behavior when plugging it back in.I understand that this is relatively similar to
power-profiles-daemon
but as it is mentioned in the TLP PPD, TLP does quite a bit more, but switching betweenBAT
andAC
is a bit limiting.Does the proposed multi-profile, multi-config approach sound feasible? I am happy to discuss this further. :)
Thanks!