1
0
mirror of https://github.com/artizirk/dotfiles.git synced 2024-11-25 17:20:58 +02:00

rearrange battery i3blocks script

This commit is contained in:
Arti Zirk 2022-02-27 13:15:20 +02:00
parent b06b6dc22d
commit ceb610585a

View File

@ -1,10 +1,15 @@
#!/bin/bash
#cd "/sys/class/power_supply/$BLOCK_INSTANCE/"
status=$(busctl get-property org.freedesktop.UPower /org/freedesktop/UPower/devices/DisplayDevice org.freedesktop.UPower.Device State | cut -d' ' -f2)
charge_f=$(busctl get-property org.freedesktop.UPower /org/freedesktop/UPower/devices/DisplayDevice org.freedesktop.UPower.Device Percentage | cut -d' ' -f2)
print_dev_status() {
dev_path=$1
status=$(busctl get-property org.freedesktop.UPower $dev_path org.freedesktop.UPower.Device State | cut -d' ' -f2)
charge_f=$(busctl get-property org.freedesktop.UPower $dev_path org.freedesktop.UPower.Device Percentage | cut -d' ' -f2)
echo -e "$charge_f %"
}
print_dev_status '/org/freedesktop/UPower/devices/DisplayDevice'
#if [[ "$charge_f" -lt 20 ]]; then
# printf '\uf244'