dotfiles

*nix config files
git clone git://git.pyratebeard.net/dotfiles.git
Log | Files | Refs | README

commit 3c841d58bfd1db577c3fefdac6bf304291d427fc
parent a123492280f840679c1949015f29d29df83295f0
Author: pyratebeard <root@pyratebeard.net>
Date:   Fri, 21 Jul 2017 14:33:11 +0100

only show batt info if 'charge_full' file exists

Diffstat:
Mbin/bin/sysinfo | 30++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/bin/bin/sysinfo b/bin/bin/sysinfo @@ -75,21 +75,23 @@ ram=`free | awk '/Mem:/ {print int($3/$2 * 100.0)}'` printf " \e[0;36m%-4s \e[1;36m%-5s %-25s \n" " ram" "$ram%" `draw $ram 15` #█▓▒░ battery -b_full=$battery/charge_full -b_now=$battery/charge_now -bf=`cat $b_full` -bn=`cat $b_now` -charge=`printf $(( 100 * $bn / $bf ))` +if [ -f $batter/charge_full ] ; then + b_full=$battery/charge_full + b_now=$battery/charge_now + bf=`cat $b_full` + bn=`cat $b_now` + charge=`printf $(( 100 * $bn / $bf ))` -case 1 in - $(($charge <= 15))) - color='31' - ;; - *) - color='36' - ;; -esac -printf " \e[0;${color}m%-4s \e[1;${color}m%-5s %-25s \n" " bat" "$charge%" `draw $charge 15 $color` + case 1 in + $(($charge <= 15))) + color='31' + ;; + *) + color='36' + ;; + esac + printf " \e[0;${color}m%-4s \e[1;${color}m%-5s %-25s \n" " bat" "$charge%" `draw $charge 15 $color` +fi #█▓▒░ volume vol=`amixer get Master | awk '$0~/%/{print $4}' | tr -d '[]%'`