i3blocks Manjaro battery status script
#1
I did this to have battery-status on the i3bar:


Code:
#!/bin/bash
#simple Shellscript for i3blocks on Pinebook pro
#05012020 [email protected] Gerhard S.
#battery-symbols: on Manjaro you need the awesome-terminal-fonts package installed!
PERCENT=$(cat /sys/class/power_supply/cw2015-battery/capacity)
STATUS=$(cat /sys/class/power_supply/cw2015-battery/status)
case $((
 $PERCENT >= 0 && $PERCENT <= 20 ? 1 :
 $PERCENT > 20 && $PERCENT <= 40 ? 2 :
 $PERCENT > 40 && $PERCENT <= 60 ? 3 :
 $PERCENT > 60 && $PERCENT <= 80 ? 4 : 5)) in
#
       (1) echo $STATUS::"" ::$PERCENT%;;
       (2) echo $STATUS::"" ::$PERCENT%;;
       (3) echo $STATUS::"" ::$PERCENT%;;
       (4) echo $STATUS::"" ::$PERCENT%;;
       (5) echo $STATUS::"" ::$PERCENT%;;
esac

and in the i3blocks-config:


Code:
[batterystat]
command=sh ~/.config/i3blocks/scripts/batterystat
interval=5
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  kernel build script for latest mainline manjaro kernel xmixahlx 3 373 02-19-2020, 07:19 PM
Last Post: xmixahlx
  full disk encryption with luks on manjaro xfce limxr 8 443 02-19-2020, 08:03 AM
Last Post: as400
  sway-git build script for latest wayland wm xmixahlx 1 183 02-13-2020, 04:19 AM
Last Post: alxndr.psclt
  mesa-git build script for latest panfrost xmixahlx 20 906 02-02-2020, 11:35 PM
Last Post: xmixahlx
  How to boot Manjaro from NVME with uboot on eMMC as400 39 914 01-30-2020, 02:23 AM
Last Post: mamboman777
  openarena build script xmixahlx 2 98 01-29-2020, 04:05 PM
Last Post: xmixahlx
  How to get kernel boot messages on screen on Manjaro as400 2 154 01-23-2020, 04:35 PM
Last Post: as400
  Manjaro: Enable Natural Scrolling (Reverse scrolling direction) kiddailey 0 128 01-22-2020, 08:10 PM
Last Post: kiddailey
Music working play/pause media keys in Manjaro KDE clover 0 122 01-14-2020, 06:46 PM
Last Post: clover
  Adjust brightness of backlight i3w-Manjaro Gerhard 0 126 01-05-2020, 04:06 PM
Last Post: Gerhard

Forum Jump:


Users browsing this thread: 1 Guest(s)