电池电量低时使系统托盘电池图标变为红色

电池电量低时使系统托盘电池图标变为红色

2018 年 4 月 14 日更新

看起来问题已经自行消失了:

鼠标电池电量低时显示为红色

power -d相关片段:

Device: /org/freedesktop/UPower/devices/keyboard_0003o046Do2010x0009
  native-path:          /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/0003:046D:C52B.0003/0003:046D:2010.0009
  vendor:               Logitech, Inc.
  model:                K800
  serial:               6DB54BFE
  power supply:         no
  updated:              Sat 14 Apr 2018 05:26:41 PM MDT (27 seconds ago)
  has history:          yes
  has statistics:       no
  keyboard
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    percentage:          20%
    icon-name:          'battery-low-symbolic'

Device: /org/freedesktop/UPower/devices/mouse_0003o046Do101Ax0008
  native-path:          /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/0003:046D:C52B.0003/0003:046D:101A.0008
  vendor:               Logitech, Inc.
  model:                Performance MX
  serial:               E6CE4571
  power supply:         no
  updated:              Sat 14 Apr 2018 05:26:40 PM MDT (28 seconds ago)
  has history:          yes
  has statistics:       no
  mouse
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    percentage:          20%
    icon-name:          'battery-low-symbolic'

内核版本:

$ uname -r
4.14.27-041427-generic

根据问题日期回顾启动日志,发现不同的内核版本(4.14.23):

$ journalctl --list-boots
-23 e9eef9c57f3543d09223d720290e0c4b Tue 2018-03-27 16:47:13 MDT—Tue 2018-03-27 17:16:48 MDT
-22 77c66f077f0e47a5b63f96d0e26fa9da Tue 2018-03-27 17:17:52 MDT—Fri 2018-03-30 11:17:30 MDT
-21 320ccedf358b4aba8b4786a1bec35b96 Fri 2018-03-30 11:52:18 MDT—Fri 2018-03-30 16:29:28 MDT
-20 d80a4dfc777b41fe86ae6f32c9a29aa1 Sat 2018-03-31 08:45:57 MDT—Sun 2018-04-01 10:18:56 MDT

$journalctl -b-22
-- Logs begin at Mon 2018-03-05 05:53:18 MST, end at Sat 2018-04-14 17:30:05 MDT. --
Mar 27 17:17:52 alien systemd-journald[295]: Runtime journal (/run/log/journal/) is 8.0M, ma
Mar 27 17:17:52 alien kernel: Linux version 4.14.23-041423-generic (kernel@kathleen) (gcc ve
Mar 27 17:17:52 alien kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-4.14.23-041423-generic 

我正在寻找这个问题的反面,他们想要关闭系统托盘上的红色电池图标:如何在指示器电源中禁用鼠标电源状态?

当键盘或鼠标的电池电量不足时,我的系统托盘(应用程序指示器)图标不会变成红色:

电源系统托盘不显示红色键盘和鼠标.png

当电池即将耗尽时,我必须依靠键盘 LED 变红,或者手动检查电力统计面板(显示在上方)。

当鼠标或键盘电池电量不足(20%)时,当连接到旧笔记本电脑时,系统托盘图标会变为红色;戴尔 Inspiron 17R 7720 SE 带 Ivybridge i-7 3630QM。它在新笔记本电脑上从未起作用;戴尔 Alienware 17R3 带 Skylake i-7 6700HQ。

可能与此有关,鼠标和键盘从未出现在电力统计直到我在启动过程中强制重新加载驱动程序:Logitech Performance MX 鼠标在电源统计中显示为“未知”

当鼠标或键盘电池电量不足时,有什么想法可以使系统托盘电池图标变为红色?


相关细节

upower -d片段(电池充电后):

Device: /org/freedesktop/UPower/devices/mouse_0003o046Do101Ax0008
  native-path:          /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/0003:046D:C52B.0003/0003:046D:101A.0008
  vendor:               Logitech, Inc.
  model:                Performance MX
  serial:               E6CE4571
  power supply:         no
  updated:              Wed 28 Mar 2018 05:28:08 PM MDT (106 seconds ago)
  has history:          yes
  has statistics:       no
  mouse
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    percentage:          90%
    icon-name:          'battery-full-symbolic'

Device: /org/freedesktop/UPower/devices/keyboard_0003o046Do2010x0009
  native-path:          /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/0003:046D:C52B.0003/0003:046D:2010.0009
  vendor:               Logitech, Inc.
  model:                K800
  serial:               6DB54BFE
  power supply:         no
  updated:              Wed 28 Mar 2018 05:28:08 PM MDT (106 seconds ago)
  has history:          yes
  has statistics:       no
  keyboard
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    percentage:          90%
    icon-name:          'battery-full-symbolic'

相关gsettings可能仅适用于主电池。例如,如果笔记本电脑在主电池电量为 100% 而鼠标电池没电时挂起,我会感到惊讶:

$ gsettings get org.gnome.settings-daemon.plugins.power percentage-critical
3
$ gsettings get org.gnome.settings-daemon.plugins.power percentage-action
2
$ gsettings get org.gnome.settings-daemon.plugins.power use-time-for-policy
false
$ gsettings get org.gnome.settings-daemon.plugins.power percentage-low
10

相关内容