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
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Manjaro ARM, Cryptomator, and MEGA Sync dp1kinobe 2 232 09-06-2020, 09:05 AM
Last Post: dp1kinobe
  Freepascal FPC3.20 and Lazarus IDE on Manjaro KDE dieselnutjob 0 212 08-02-2020, 06:57 AM
Last Post: dieselnutjob
  Installing WPS Office on Manjaro brent.thierens 5 1,197 07-13-2020, 03:13 AM
Last Post: brent.thierens
  kernel build script for latest mainline manjaro kernel xmixahlx 42 6,719 07-11-2020, 09:01 PM
Last Post: xmixahlx
  full disk encryption with luks on manjaro xfce limxr 48 7,554 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 696 06-23-2020, 12:41 AM
Last Post: pljanson
  mesa-git build script for latest panfrost xmixahlx 28 6,023 06-11-2020, 11:16 PM
Last Post: xmixahlx
  How to boot Manjaro from NVME with uboot on eMMC as400 47 6,518 06-07-2020, 02:37 AM
Last Post: as400
  Instructions for Installing VS Code on Manjaro clover 6 2,607 06-04-2020, 09:37 PM
Last Post: pfeerick
  QGroundcontrol on Manjaro chaoskampf 0 352 04-06-2020, 05:12 PM
Last Post: chaoskampf

Forum Jump:


Users browsing this thread: 1 Guest(s)