Browse Source

Optimize battery script

master
Riyyi 7 years ago
parent
commit
0318e459c5
  1. 3
      .scripts/wm/battery.sh

3
.scripts/wm/battery.sh

@ -1,7 +1,6 @@
#!/bin/sh #!/bin/sh
BAT_NUMBER=${BLOCK_INSTANCE:-"$(acpi -b | grep ': [^Unknown]' | awk '{ print int($2) }')"} BAT_INFO=${BLOCK_INSTANCE:-"$(acpi -b | grep ': [^Unknown]')"}
BAT_INFO="$(acpi -b | grep Battery\ $BAT_NUMBER:)"
CAPACITY=$(echo $BAT_INFO | awk '{ print int($4) }') CAPACITY=$(echo $BAT_INFO | awk '{ print int($4) }')
TIME="$(echo $BAT_INFO | awk '{ print substr($5, 0, length($5) - 3) }')" TIME="$(echo $BAT_INFO | awk '{ print substr($5, 0, length($5) - 3) }')"

Loading…
Cancel
Save