惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
G
Google Developers Blog
B
Blog
Engineering at Meta
Engineering at Meta
阮一峰的网络日志
阮一峰的网络日志
The Register - Security
The Register - Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 叶小钗
The Cloudflare Blog
The Hacker News
The Hacker News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
雷峰网
雷峰网
F
Fortinet All Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
T
Threat Research - Cisco Blogs
A
About on SuperTechFans
量子位
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
H
Help Net Security
Help Net Security
Help Net Security
P
Palo Alto Networks Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Troy Hunt's Blog
W
WeLiveSecurity
V
Vulnerabilities – Threatpost
T
The Exploit Database - CXSecurity.com
Know Your Adversary
Know Your Adversary
Apple Machine Learning Research
Apple Machine Learning Research
Scott Helme
Scott Helme
N
News | PayPal Newsroom
AWS News Blog
AWS News Blog
D
DataBreaches.Net
Blog — PlanetScale
Blog — PlanetScale
MongoDB | Blog
MongoDB | Blog
B
Blog RSS Feed
腾讯CDC
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
TaoSecurity Blog
TaoSecurity Blog
GbyAI
GbyAI
Y
Y Combinator Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
D
Docker

Linux – Ed_'s Blog

给 Debian 开了自动安全更新 – yywr's Blog Samba 服务基本用法 – yywr's Blog Crontab 使用笔记 – yywr's Blog Linux 程序开机启动并保活:Systemd 进程守护管理工具 – yywr's Blog Linux 下自动挂载 Samba /CIFS 共享文件夹 – yywr's Blog Ubuntu 开机自动挂载第二块硬盘 – yywr's Blog 重装了家里的服务器系统 – yywr's Blog Ubuntu 笔记本合盖子不休眠的方法 – yywr's Blog
UPower – 将笔记本电池当成UPS使用 – yywr's Blog
yywr · 2024-10-26 · via Linux – Ed_'s Blog

Skip to content

由于我使用老旧笔记本作为私有云使用,除了之前提到的「合盖子不休眠」的设置外,电池的设置也是一项很有用的设定,谁也不知道哪次的突然断电会不会带来意想到不到的结果,所以 UPower 安排起来

UPower 的功能描述太抽象,就不抄了,自己官网看(https://upower.freedesktop.org)

准备

  • 安装: apt install upower
  • 开机启动:systemctl enable upower

配置

打开配置文件并编辑,文件在:/etc/UPower/UPower.conf (注意大小写)

找到下面几个参数进行设置

  • 前三项分别是「低电量,临界值,动作执行」时的电量百分比
  • 最后一项是动作执行,可选关机、休眠、混合睡眠(PowerOff / Hibernate / HybridSleep)
PrecentageLow=40
PercentageCritical=30
PercentageAction=20
CriticalPowerAction=HybridSleep

保存配置文件后,重启服务 systemctl restart upower

其它补充

为什么我的值设置的这么高,因为我的电池不行了,56Wh 的出厂设计容量,现在只有 12.5Wh,随时断电

可以通过下面方式查看电池信息

  • 查看电池名称: upower -e 
  • 查看具体的电池信息: upower -i 上一条命令查到的电池名称
  • 更多使用方法:upower -h

以上

本文是 居家服务器折腾笔记 的一部分