I once started this discussion on the old forum and would like to find ideas, how a default installation could detect if the target actually requires TLP, to avoid installations on Desktop PC’s.
Unfortunately TLP does not always work well on Desktop machines, which can lead to hard to find performance and stability issues, as it messes around with power management.
This issues with TLP can be a huge frustration factor for the “average” user, because a lot of them are hard to debug and understand in the first place.
Like the machine hanging/restarting for no reason, sound popping issues etc.
The idea is to check if a battery is available on the targeting system and to then remove TLP if none has been found. Opt-Out so to speak, which could be for example done with a post installation script.
As far as I’m aware there are tools like upower and acpi which should be capable to reliably detect if a battery is available.
Here a example script with upower:
#!/bin/bash
file=.upower.txt
check="$(upower -d | grep 'power supply' | tee "$file")"
if [[ -n "$check" ]]; then
cat "$file" | cut -c 25- | head -1 | tee "$file" &>/dev/null
if [[ "$(cat "$file")" == "no" ]]; then
echo " No battery found, removing TLP to avoid performance issues ..."
rm -rf "$file" &>/dev/null
exit
else
echo "Battery found"
rm -rf "$file" &>/dev/null
exit
fi
fi
@Manjaro-Team any thoughts?