AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1149643
Accepted
QkiZ
QkiZ
Asked: 2019-06-09 10:30:10 +0800 CST2019-06-09 10:30:10 +0800 CST 2019-06-09 10:30:10 +0800 CST

笔记本电脑低电量不关机

  • 772

我对 Ubuntu 19.04 有问题。当电池电量不足时,系统不会以正常方式关闭。当电池电量降至 3% 时,笔记本电脑正在关闭,就像我拔出电池一样。

laptop battery
  • 1 1 个回答
  • 758 Views

1 个回答

  • Voted
  1. Best Answer
    WinEunuuchs2Unix
    2019-06-11T14:45:51+08:002019-06-11T14:45:51+08:00

    除非最近有什么改变,否则你应该有这个文件:/etc/UPower/UPower.conf包含:

    # Only the system vendor should modify this file, ordinary users
    # should not have to change anything.
    
    [UPower]
    
    # Enable the Watts Up Pro device.
    #
    # The Watts Up Pro contains a generic FTDI USB device without a specific
    # vendor and product ID. When we probe for WUP devices, we can cause
    # the user to get a perplexing "Device or resource busy" error when
    # attempting to use their non-WUP device.
    #
    # The generic FTDI device is known to also be used on:
    #
    # - Sparkfun FT232 breakout board
    # - Parallax Propeller
    #
    # default=false
    EnableWattsUpPro=false
    
    # Don't poll the kernel for battery level changes.
    #
    # Some hardware will send us battery level changes through
    # events, rather than us having to poll for it. This option
    # allows disabling polling for hardware that sends out events.
    #
    # default=false
    NoPollBatteries=false
    
    # Do we ignore the lid state
    #
    # Some laptops are broken. The lid state is either inverted, or stuck
    # on or off. We can't do much to fix these problems, but this is a way
    # for users to make the laptop panel vanish, a state that might be used
    # by a couple of user-space daemons. On Linux systems, see also
    # logind.conf(5).
    #
    # default=false
    IgnoreLid=false
    
    # Policy for warnings and action based on battery levels
    #
    # Whether battery percentage based policy should be used. The default
    # is to use the time left, change to true to use the percentage, which
    # should work around broken firmwares. It is also more reliable than
    # the time left (frantically saving all your files is going to use more
    # battery than letting it rest for example).
    # default=true
    UsePercentageForPolicy=true
    
    # When UsePercentageForPolicy is true, the levels at which UPower will
    # consider the battery low, critical, or take action for the critical
    # battery level.
    #
    # This will also be used for batteries which don't have time information
    # such as that of peripherals.
    #
    # If any value is invalid, or not in descending order, the defaults
    # will be used.
    #
    # Defaults:
    # PercentageLow=10
    # PercentageCritical=3
    # PercentageAction=2
    PercentageLow=10
    PercentageCritical=3
    PercentageAction=2
    
    # When UsePercentageForPolicy is false, the time remaining at which UPower
    # will consider the battery low, critical, or take action for the critical
    # battery level.
    #
    # If any value is invalid, or not in descending order, the defaults
    # will be used.
    #
    # Defaults:
    # TimeLow=1200
    # TimeCritical=300
    # TimeAction=120
    TimeLow=1200
    TimeCritical=300
    TimeAction=120
    
    # The action to take when "TimeAction" or "PercentageAction" above has been
    # reached for the batteries (UPS or laptop batteries) supplying the computer
    #
    # Possible values are:
    # PowerOff
    # Hibernate
    # HybridSleep
    #
    # If HybridSleep isn't available, Hibernate will be used
    # If Hibernate isn't available, PowerOff will be used
    CriticalPowerAction=HybridSleep
    

    当百分比为真(默认)时,行:

    PercentageLow=10
    PercentageCritical=3
    PercentageAction=2
    

    表示剩余 10% 时您会被告知电池电量不足。剩余 3% 时会发出严重警告,称电池即将耗尽。剩余 2% 时,您的机器将关闭。

    当百分比为假时,以下行:

    TimeLow=1200
    TimeCritical=300
    TimeAction=120
    

    表示在剩余 1200 秒(20 分钟)时,您会被告知电池电量不足。在剩余 300 秒(5 分钟)时会发出严重警告,表示电池即将耗尽。在剩余 120 秒(2 分钟)时,您的机器将关闭。

    配置文件设置应重复gsettings,您可以在其中确认:

    $ gsettings list-recursively | grep plugins.power | grep time
    org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
    org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0
    org.gnome.settings-daemon.plugins.power time-low 1200
    org.gnome.settings-daemon.plugins.power time-action 120
    org.gnome.settings-daemon.plugins.power time-critical 300
    org.gnome.settings-daemon.plugins.power use-time-for-policy true
    

    与:

    $ gsettings list-recursively | grep plugins.power | grep percentage
    org.gnome.settings-daemon.plugins.power percentage-low 10
    org.gnome.settings-daemon.plugins.power percentage-critical 3
    org.gnome.settings-daemon.plugins.power percentage-action 2
    
    • 3

相关问题

  • 我可以将电源指示灯设置为显示电池百分比而不是剩余时间吗?

  • 如何在默认设置不起作用的笔记本电脑上使休眠/睡眠工作?

  • 如何解决联想笔记本电脑上恢复/电源问题时禁用的蓝牙?

  • 延长笔记本电脑和笔记本电脑电池寿命的技巧

  • 上网本版电池寿命 - Ubuntu 与 Kubuntu?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve