home/bin/mouse_battery.sh

7 lines
203 B
Bash
Raw Normal View History

2020-11-02 09:56:35 +01:00
#! /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}%