Battery popout shows phantom 0% "Stylus" peripheral when no pen is present
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- linux
- Domain
- desktop
Research direction
Open quickshell/Services/BatteryService.qml and find the peripheralDevices filter that currently requires only dev.ready; read the surrounding peripheralIcon helper and the UPower device properties it relies on to confirm isPresent is exposed there. Add the presence check to the filter, then open the battery popout on a machine (or with a mocked UPower device) whose digitizer reports a not-present battery and confirm the phantom Stylus tile is gone while real peripherals still list. Done means no 0% entry for a device UPower reports as absent.
Written by the indexing model from the issue text.
Description
Summary
The battery popout shows a phantom "Stylus" peripheral at 0% on laptops whose touchscreen digitizer declares a pen battery, even though no pen exists or is connected. The kernel marks that battery as not present, but BatteryService.peripheralDevices does not check this.
Steps to reproduce
- Use a laptop with an ELAN HID touchscreen/digitizer (here
ELAN9008:00 04F3:2F2C) and no pen. - Open the battery popout / control center battery detail.
- A peripheral tile appears: icon, 0%, name
ELAN9008:00 04F3:2F2C Stylus.
Expected
Devices that UPower reports as not present are not listed as peripherals.
Actual
A permanent 0% "Stylus" entry is shown.
Analysis
The kernel hid-input driver creates a power_supply for any HID device that declares a battery usage, regardless of whether a pen is paired:
/sys/class/power_supply/hid-0018:04F3:2F2C.0002-battery-7
type: Battery
scope: Device
present: 0
capacity: 0
status: Unknown
upower -i for it reports power supply: no, battery-level: unknown, percentage: 0% (should be ignored).
In quickshell/Services/BatteryService.qml, the filter is:
readonly property var peripheralDevices: refCount === 0 ? [] : UPower.devices.values.filter(dev => dev && dev.ready && !dev.isLaptopBattery && peripheralIcon(dev.type) !== "").map(...)
It only requires dev.ready, so the non-present device passes. UPowerDevice.isPresent is false here.
Suggested fix
Also require the device to be present (and optionally skip unknown state):
UPower.devices.values.filter(dev => dev && dev.ready && dev.isPresent && !dev.isLaptopBattery && peripheralIcon(dev.type) !== "")
UPOWER_IGNORE is not an option on the system side: UPower 1.91.5 does not honor it, and the kernel has no runtime switch to drop this battery.
Environment
- dux-shell 2.1.2-1 (Arch Linux package)
- UPower 1.91.5
- Linux 7.3.5-arch1-1
- Compositor: Hyprland
- Dominant language
- QML
- Stars
- 8.4k
- Forks
- 549
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AvengeMedia/DankMaterialShell
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
AvengeMedia/DankMaterialShell#4490 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
AvengeMedia/DankMaterialShell#4481 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
AvengeMedia/DankMaterialShell#4465 ·
-
Enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
AvengeMedia/DankMaterialShell#4456 · 2 comments ·
-
Enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
AvengeMedia/DankMaterialShell#4452 ·
All issues in AvengeMedia/DankMaterialShell
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
SubtitleEdit/subtitleedit#17351 ·
Maintainers usually reply within 1 day
-
os:Windows
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug :bug:
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Nouuu/Albion-Online-OpenRadar#243 ·