home/bin/mouse_battery.sh
2021-01-24 15:16:13 +01:00

6 lines
203 B
Bash
Executable file

#! /bin/bash
MOUSE_PATH=`qdbus --system org.freedesktop.UPower|grep mouse`
PERCENTAGE=`qdbus --system org.freedesktop.UPower ${MOUSE_PATH} org.freedesktop.UPower.Device.Percentage`
echo ${PERCENTAGE}%