xfce4-genmon-scripts
xfce4-genmon-scripts copied to clipboard
Dualshock 3/4 gamepad battery percentage support
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?
A new branch was created for the development of the new feature @samuk190 please refer here
Gamepad support has been added and it is ready to be tested.
The generic monitor command should be
/path/to/xfce4-genmon-scripts/gamepad-panel.sh
Please test it while having multiple gamepads connected.
Gamepad support has been added and it is ready to be tested.
The generic monitor command should be
/path/to/xfce4-genmon-scripts/gamepad-panel.sh
Please test it while having multiple gamepads connected.
great, I tested here with 2 ds3 controllers its working very well thanks :) Just a suggestion, it need some padding between each 100% or make it like in rows to ocuppy less space and make it color red when less than 15% https://i.imgur.com/eu2PVP9.png
Well, the two "100%" strings shouldn't be there. My thought is:
- Optionally define which device to display on panel
- If no device is specified, the first is automatically selected (the first line of the command
find
) - All devices will be displayed in tooltip (name and battery percentage)
Well, the two "100%" strings shouldn't be there. My thought is:
* Optionally define which device to display on panel * If no device is specified, the first is automatically selected (the first line of the command `find`) * All devices will be displayed in tooltip (name and battery percentage)
getting both displaying battery isnt bad, I thought it is good if show in a row, and 4-row column and other info at tooltip. Also if its going to show 100% strings, need a padding between it and the icon
Could you check again? I added a space between two battery percentages.
Could you check again? I added a space between two battery percentages.
Sure! here the result, but I disliked it as it was too near the volume icon and too near the gamepad icon so I made a small change. https://i.imgur.com/ven4Kvs.png
Here the change(removed blank space at end and added at start): https://i.imgur.com/5hl95M4.png
here the result: https://i.imgur.com/M6Vr0Gd.png
to make it better I think it would be nice to add battery icon with % for every gamepad, https://i.imgur.com/6dGaqrL.png But that would be my work right? If you like I can try photoshop it
https://i.imgur.com/6dGaqrL.png example of ideas
- 4 icons one for fully charged, one for charging, one for half and one for low charge. or
- one icon with no color only "gamepad icon + battery" and percentage inside of it(idk if this is possible on bash script), and make another icon if charging.
Just a idea, to be more simple it could be one icon on top, percentage on bottom, and icon if its charging or not. Anyways great work, I can say now that my xfce desktop is complete