I wondering what commands can be used to make the system as smooth and battery saving as possible. Similar to how XFCE is in Antergos or Manjaro.
3 Answers
I recommend installing TLP. You can do this with sudo apt install tlp
in the terminal. TLP is a power management tool that comes with a preconfigured profile that should help increase battery life and power management overall, and can handle plugged and unplugged modes respectively. To enable it after install, type sudo tlp start
and to check its status, use sudo tlp stat
. Keep in mind that Ubuntu and furthermore Elementary are considerably more demanding systems than most Arch or Arch based ones, and with the Pantheon desktop, you'll also see some more resource demands. I recommend adjusting brightness if you can, and if you want further control, you can edit the TLP profile to handle things the way you want them to be handled. Here's the ArchWiki page for further information on TLP itself. https://wiki.archlinux.org/index.php/TLP
-
I do have TLP installed, but I was wondering whether there are something else I could do to improve performance or boot times? gist.github.com/evertontrindade/… << Is the cleanup System part a good way to go? Commented Jan 10, 2018 at 15:15
-
Hmm, for boot times, you could disable Plymouth (the animation at bootup) and/or give systemd-boot a try, though I wouldn't advise the secondary unless you're comfortable breaking things. I'll take a look at that link there, haven't seen it before.– user9220Commented Mar 11, 2018 at 19:51
What I did to improve mine was dig deep onto TLP configuration file in order to craft a very efficient power profile for my laptop. Now it runs cold, rarely uses more than one CPU core and the battery life is on par to what I'd get on Windows 10. And If I want, I can unleash all power by sudo tlp ac
on Terminal, which puts it in AC mode and knocks the hardware into high gear for gaming or whatever.
You can find the file by sudo scratch-text-editor /etc/default/tlp
What you'll see is the main config file which TLP reads to enforce its power management into your system. Provided you know what you are doing, you can craft a very power efficient profile out of this at the expense of some processing power, off course.
If you don't know how to edit the TLP config file, I'd strongly advise you to learn more about it first at http://linrunner.de/en/tlp/docs/tlp-configuration.html and even then be pretty cautious about what you are doing and changing.
I installed PowerTop and ran it for a while (having tried all the usual solutions). I identified the different processes that were consuming power. Wifi was the worst but that is something that I generally need so I singled that out for special consideration. I then wrote a script that essentially went like this:
#! /bin/bash
# Read from a list of processes (~/.suspendprocesses) and go through each on suspending them by calling pkill -stop <process>
# To resume, run mobileresume.
# Must be run as sudo
# check running as sudo otherwise exit
if [ ! $USER == root ]; then
echo "mobilesuspend must be run as root"
exit
fi
# run through items in file
while read p; do
if [ ! ${p:0:1} == "#" ]; then
if [ $(echo $p | cut -d' ' -f 1) == "-STOP" ]; then
pkill -f $p
elif [ ! $p == "" ]; then
pkill -f -TSTP $p
fi
fi
done < ~/.suspendprocesses
and put the list of the processes that I felt I could temporarily do without whilst conserving power in ~/.suspendprocesses.
Of course this is also a companion app to resume them when I have power again:
#! /bin/bash
# Read from a list of processes (~/.suspendprocesses) and go through each one and resume them by calling pkill -CONT <process>
# To suspend them, run moilesuspend.
# Must be run as sudo
# check running as sudo otherwise exit
if [ ! $USER == root ]; then
echo "mobileresume must be run as root"
exit
fi
# run through items in file
while read p; do
if [ ! ${p:0:1} == "#" ]; then
if [ ! $p == "" ]; then
if [ $(echo $p | cut -d' ' -f 1) == "-STOP" ]; then
p = $(echo $p | cut -d' ' -f 2)
fi
pkill -f -CONT $p
fi
fi
done < ~/.suspendprocesses
I have something similar to stop the wifi card from draining power (and believe me, that one is the big consumer) but run that totally separately for obvious reasons. I'll leave that as an exercise for the reader!
When I go on a long journey, simply calling this script can double the life of my battery. Killing wifi can add another big amount.
Note for all: Check how much power and bandwidth Skype consumes even when "idle"...