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 geri123@gmx.net 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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Building PPSSPP with Manjaro AUR LivingLinux 0 1,516 06-11-2022, 05:07 PM
Last Post: LivingLinux
  How to update Manjaro to 20.10 pineitup 8 15,392 07-31-2021, 04:44 AM
Last Post: jiyong
  Make your own Manjaro image flatulent_piney 0 3,622 11-07-2020, 03:30 AM
Last Post: flatulent_piney
  Manjaro ARM, Cryptomator, and MEGA Sync dp1kinobe 3 8,015 10-24-2020, 06:38 AM
Last Post: pineitup
  Downgrading packages on Manjaro ARM (on the example of boinc) wrzomar 0 3,778 10-02-2020, 12:20 PM
Last Post: wrzomar
  Freepascal FPC3.20 and Lazarus IDE on Manjaro KDE dieselnutjob 0 3,192 08-02-2020, 06:57 AM
Last Post: dieselnutjob
  Installing WPS Office on Manjaro brent.thierens 5 10,892 07-13-2020, 03:13 AM
Last Post: brent.thierens
  kernel build script for latest mainline manjaro kernel xmixahlx 42 65,636 07-11-2020, 09:01 PM
Last Post: xmixahlx
  full disk encryption with luks on manjaro xfce limxr 48 76,832 07-09-2020, 07:27 AM
Last Post: JtR
  Is there a MMC upgrade instruction from debian-mate to manjaro factory (20.06)? pljanson 4 9,024 06-23-2020, 12:41 AM
Last Post: pljanson

Forum Jump:


Users browsing this thread: 2 Guest(s)