all repos — dotfiles @ 0e5edf1bf7997eb26c9756e09b3423f0aa41e6c6

my *nix dotfiles

bin/bat.sh (view raw)

 1#!/usr/bin/env bash
 2
 3fg="$(xres color15)"
 4light="$(xres color8)"
 5
 6cap=$(cat /sys/class/power_supply/BAT0/capacity)
 7status=$(cat /sys/class/power_supply/BAT0/status)
 8
 9if [[ "$status" = "Charging" ]]
10then
11	echo -ne "%{F$light}+bat %{F$fg}$cap%"
12else
13	echo -ne "%{F$light}bat %{F$fg}$cap%"
14fi