Advertisement
clairec

battery

Jan 2nd, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.25 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. PERC=`acpi | sed -nr "s/.*[^0-9]([0-9]{1,3})%.*/\1/p"`
  4. LOWPOWER=20
  5.  
  6. if [ $PERC -lt $LOWPOWER ]
  7.   then
  8.     echo -n "#[fg=red,bold]#[bg=black]! ~ "
  9. fi
  10.  
  11. echo -n $PERC%
  12.  
  13.  
  14. if [ $PERC -lt $LOWPOWER ]
  15.   then
  16.     echo -n " ~ !#[fg=none]#[bg=none]"
  17. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement