Browse Source

rearrange battery i3blocks script

master
Arti Zirk 3 years ago
parent
commit
ceb610585a
  1. 9
      .config/i3blocks/battery

9
.config/i3blocks/battery

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

Loading…
Cancel
Save