Skip to content

Dualshock 3/4 gamepad battery percentage support #7

Description

@xtonousou

From @samuk190

Do you know where I can get stats from dualshock3/4 battery? I want to create a script to show dualshock battery.

With the help of some other devs I discovered how to get battery percentage:

upower -e  # to discover devices
upower -i /org/freedesktop/UPower/devices/gaming_input_sony_controller_battery_00o06of5obbo49o42

The approach with upower, I guess it is compatible with recent linux?
An alternative approach:

cat /sys/class/power_supply/sony_controller_battery_<device_id>/capacity
cat /sys/class/power_supply  # (lists all controllers)

Just need to do something like a for loop to list all connected controllers and show their respective battery. Can you help doing the interface and the loop to get all connected controllers?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions