亲宝软件园·资讯

展开

linux省电三步骤

ManWingloeng 人气:1

前言

我的是deepin系统,因为新买了magicbook pro笔记本(i5版),在windows下续航能够有10小时,但是在linux下耗电迅速只能三四小时,所以我对系统进行了省电优化,能够日常使用可以续航7小时以上。

步骤一

安装tlp

sudo apt-get install tlp tlp-rdw
systemctl enable tlp
systemctl enable tlp-sleep

步骤二

安装powertop

sudo apt-get install powertop
vim /etc/systemd/system/powertop.service

写一个powertop的服务
其实就是写powertop --auto-tune自动优化

[Unit]
Description=PowerTOP auto tune
[Service]
Type=idle
Environment="TERM=dumb"
ExecStart=/usr/sbin/powertop --auto-tune
[Install]
WantedBy=multi-user.target

同样也是enable该服务
systemctl enable powertop

步骤三

powersave写入cpu管理

vim /etc/rc.local

好像默认是balance的,我设置省电模式,但是我没做cpu降频了,因为本身就是轻薄本我还得跑跑代码,降频怕带不动了。

#!/bin/bash
# save power
echo 'powersave' > /syshttps://img.qb5200.com/download-x/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 'powersave' > /syshttps://img.qb5200.com/download-x/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo 'powersave' > /syshttps://img.qb5200.com/download-x/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo 'powersave' > /syshttps://img.qb5200.com/download-x/devices/system/cpu/cpu3/cpufreq/scaling_governor
echo 'powersave' > /syshttps://img.qb5200.com/download-x/devices/system/cpu/cpu4/cpufreq/scaling_governor
echo 'powersave' > /syshttps://img.qb5200.com/download-x/devices/system/cpu/cpu5/cpufreq/scaling_governor
echo 'powersave' > /syshttps://img.qb5200.com/download-x/devices/system/cpu/cpu6/cpufreq/scaling_governor
echo 'powersave' > /syshttps://img.qb5200.com/download-x/devices/system/cpu/cpu7/cpufreq/scaling_governor
# powertop --auto-tune
exit 0

加载全部内容

相关教程
猜你喜欢
用户评论