Skip to content

Add devices to disable for power saver, decoupleing balanced and powersaver#892

Open
dusklinux wants to merge 3 commits into
linrunner:mainfrom
dusklinux:main
Open

Add devices to disable for power saver, decoupleing balanced and powersaver#892
dusklinux wants to merge 3 commits into
linrunner:mainfrom
dusklinux:main

Conversation

@dusklinux

Copy link
Copy Markdown

No description provided.

@dusklinux dusklinux changed the title Add devices to disable for for power saver, decoupleing balanced and powersaver Add devices to disable for power saver, decoupleing balanced and powersaver Jul 2, 2026
@linrunner

Copy link
Copy Markdown
Owner

Thanks in advance. I'm busy right now, but I'll check back when I have time.

@dusklinux

dusklinux commented Jul 3, 2026

Copy link
Copy Markdown
Author

No problem.

The code base was well written, and required only surgical edits because the groundwork was already laid out. I only added ~38 liines using the same logic you already had in place.

@dusklinux

This comment was marked as off-topic.

@linrunner

linrunner commented Jul 6, 2026

Copy link
Copy Markdown
Owner

This approach isn't complete yet, the topic is more complicated.

When switching from balanced to power-saver profile, the radios listed in DEVICES_TO_DISABLE_ON_SAV get disabled. However, when switching from power-saver back to balanced, nothing happens. I'm guessing that's not what you're expecting.

@dusklinux

Copy link
Copy Markdown
Author

That's interesting, I'll re-test to make sure it works, and push the commit where it needs fixing.

@linrunner

linrunner commented Jul 6, 2026

Copy link
Copy Markdown
Owner

We'll need a DEVICES_TO_ENABLE_ON_BAT.

In addition, the fallback DEVICES_TO_DISABLE_ON_BAT -> _SAV is up for discussion. I consider it counterproductive and confusing in the extended scenario.

Finally, I'd like to consolidate the sections in tlp.conf; otherwise, it will become overwhelming. I'll do that myself once functionality is finished.

@dusklinux

Copy link
Copy Markdown
Author

I have updated the pr to address your feedback:

Added DEVICES_TO_ENABLE_ON_BAT and DEVICES_TO_ENABLE_ON_SAV to give users explicit control over enabling specific devices when transitioning back to the balanced profile.

Removed the fallback behavior between _BAT and _SAV configuration options, making the profiles completely independent.

Updated tlp.conf.in with documentation for the new variables and removed fallback descriptions.

I have tested transitions between all profiles (performance, balanced, power-saver) on my system, and the devices now enable and disable correctly. I made sure to have it match the naming scheme that you already had in place.

I spent the last two hours figuring it out and fixing it. I've stress tested it every whichway, rest assured it works well now.

@linrunner

Copy link
Copy Markdown
Owner

Great. I'm still working on something else right now. I'll take a look at it after that.

@dusklinux

Copy link
Copy Markdown
Author

Alright, I wont hold my breath,

@fayizshaffaq

Copy link
Copy Markdown

@dusklinux will tlp setup be re added to dusky after this is merged?

@dusklinux

Copy link
Copy Markdown
Author

Yup.

@linrunner

linrunner commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Your code works.

I merged it externally, not here on the platform. Please make sure in the future that there are no “commit accidents” in the history. A push --force to a dedicated branch is perfectly acceptable in such a case.

Before this goes to main, I’ll make some additional changes:

  • Automated test
  • Consolidate/shorten tlp.conf
  • Replace DEVICES_TO_DISABLE/ENABLE_ON_STARTUP - we’ll handle that using the profile-specific variables (we’ll also need DEVICES_TO_DISABLE_ON_AC for that)
  • Handle conflicting configurations; e.g., DEVICES_TO_DISABLE_ON_BAT=“wifi” and DEVICES_TO_ENABLE_ON_BAT=“wifi” cancel each other out, so no action is needed.
  • Take into account profile changes after suspend/resume
  • Consolidate the code even further

When someone points out an issue to me, I sometimes spontaneously come up with further ideas...

Stay tuned!

@dusklinux

Copy link
Copy Markdown
Author

Perfect! Sounds great! I'll keep that in mind.
Thank you! Let me know if you need anything at all, any testing or whatever.

@linrunner

Copy link
Copy Markdown
Owner

Testing of course.

@dusklinux

Copy link
Copy Markdown
Author

Anytime. Just let me know when, and provide a link to the project with the updated logic.

@Mylinde

Mylinde commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

I would like to point out that two different things are being mixed here. Namely the energy source BAT/AC and energy profiles SAV/BAL/PRF, which can be configured for each regardless of the energy source. DEVICES_TO_DISABLE_ON_BAT/AC and DEVICES_TO_ENABLE_ON_BAT/AC would therefore have to be completely replaced by ON_SAV/BAL/PRF

@dusklinux

Copy link
Copy Markdown
Author

I would like to point out that two different things are being mixed here. Namely the energy source BAT/AC and energy profiles SAV/BAL/PRF, which can be configured for each regardless of the energy source. DEVICES_TO_DISABLE_ON_BAT/AC and DEVICES_TO_ENABLE_ON_BAT/AC would therefore have to be completely replaced by ON_SAV/BAL/PRF

Yes, I only figured that out after the fact, you're entirely correct and great catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants