home/Bin/device_battery.sh
2020-11-17 13:58:04 +01:00

6 lines
200 B
Bash
Executable file

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