我在 Dell XPS 15 9520 上安装了 Kubuntu 22,当我断开电源线时,笔记本电脑无法识别。它只显示“已连接但未充电”。所以现在发生了多次,我没有收到电池电量不足的通知,一直耗尽电量直到笔记本电脑关机 - 这对电池寿命不利。
我尝试acpi_listen
在控制台上调用,电源断开事件实际上是由内核发送的。
ac_adapter ACPI0003:00 00000080 00000000
battery PNP0C0A:00 00000080 00000001
sudo journalctl --follow
连接或断开电源线时通话不显示任何内容。
调用upower -d
显示以下输出:
Device: /org/freedesktop/UPower/devices/line_power_AC
native-path: AC
power supply: yes
updated: Wed Jan 24 08:45:15 2024 (5414 seconds ago)
has history: no
has statistics: no
line-power
warning-level: none
online: yes
icon-name: 'ac-adapter-symbolic'
Device: /org/freedesktop/UPower/devices/battery_BAT0
native-path: BAT0
vendor: BYD
model: DELL M59JH25
serial: 879
power supply: yes
updated: Wed Jan 24 10:15:14 2024 (15 seconds ago)
has history: yes
has statistics: yes
battery
present: yes
rechargeable: yes
state: fully-charged
warning-level: none
energy: 83.0832 Wh
energy-empty: 0 Wh
energy-full: 83.0832 Wh
energy-full-design: 84.2916 Wh
energy-rate: 0.0114 W
voltage: 12.67 V
charge-cycles: N/A
percentage: 100%
temperature: 26.7 degrees C
capacity: 98.5664%
technology: lithium-polymer
icon-name: 'battery-full-charged-symbolic'
Device: /org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o001
native-path: ucsi-source-psy-USBC000:001
power supply: yes
updated: Wed Jan 24 08:45:15 2024 (5414 seconds ago)
has history: no
has statistics: no
line-power
warning-level: none
online: no
icon-name: 'ac-adapter-symbolic'
Device: /org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o002
native-path: ucsi-source-psy-USBC000:002
power supply: yes
updated: Wed Jan 24 08:45:15 2024 (5414 seconds ago)
has history: no
has statistics: no
line-power
warning-level: none
online: no
icon-name: 'ac-adapter-symbolic'
Device: /org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o003
native-path: ucsi-source-psy-USBC000:003
power supply: yes
updated: Wed Jan 24 08:45:15 2024 (5414 seconds ago)
has history: no
has statistics: no
line-power
warning-level: none
online: yes
icon-name: 'ac-adapter-symbolic'
Device: /org/freedesktop/UPower/devices/mouse_[...]
native-path: /org/bluez/hci0/[...]
model: [...]
serial: [...]
power supply: no
updated: Wed Jan 24 08:45:25 2024 (5404 seconds ago)
has history: yes
has statistics: no
mouse
present: yes
rechargeable: no
state: unknown
warning-level: none
percentage: 64%
icon-name: 'battery-missing-symbolic'
Device: /org/freedesktop/UPower/devices/keyboard_[...]
native-path: /org/bluez/hci0/[...]
model: [...]
serial: [...]
power supply: no
updated: Wed Jan 24 08:47:21 2024 (5288 seconds ago)
has history: yes
has statistics: no
keyboard
present: yes
rechargeable: no
state: unknown
warning-level: none
percentage: 90%
icon-name: 'battery-missing-symbolic'
Device: /org/freedesktop/UPower/devices/DisplayDevice
power supply: yes
updated: Wed Jan 24 08:45:14 2024 (5415 seconds ago)
has history: no
has statistics: no
battery
present: yes
state: fully-charged
warning-level: none
energy: 83.0832 Wh
energy-full: 83.0832 Wh
energy-rate: 0.0114 W
charge-cycles: N/A
percentage: 100%
icon-name: 'battery-full-charged-symbolic'
Daemon:
daemon-version: 0.99.17
on-battery: no
lid-is-closed: no
lid-is-present: yes
critical-action: PowerOff
有什么想法可以让它识别电源断开吗?
答案1
问题出在显示电池指示器的 GUI 上。执行sudo apt install kde-full
或使用特定软件包来修复此问题。
正如您在问题中所写,内核和后端不是问题。ACPI 正确获取了消息。upower 正确报告了设备的当前状态battery_BAT0
为percentage: 100%
和icon-name: 'battery-full-charged-symbolic'
。
因此问题出在您的用户空间桌面环境中。插入和拔出电源线时通常会有声音,因此请确保您没有禁用该功能。任务栏电池指示器在电量达到 100% 时会自动隐藏和取消隐藏,因此请单击^
图标将其取消隐藏。
电池状态指示器小程序本身由软件包提供,plasma-workspace-data
因此它不应该是缺失的。但是,它从 KDE 的电源管理守护程序 PowerDevil 获取数据。最小 KDE 安装可能不包含此软件包,如果您不想安装所有 KDE,您可以尝试只安装kde-plasma-desktop
并重新登录。