Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.2 KiB

4 years ago
  1. #! /bin/sh
  2. bat=$(cat /sys/class/power_supply/BAT0/capacity)
  3. status=$(cat /sys/class/power_supply/BAT0/status)
  4. ramp10=󰁺
  5. ramp20=󰁻
  6. ramp30=󰁼
  7. ramp40=󰁽
  8. ramp50=󰁾
  9. ramp60=󰁿
  10. ramp70=󰂀
  11. ramp80=󰂁
  12. ramp90=󰂂
  13. ramp100=󰁹
  14. tbg=^b#cdabb8^
  15. tfg=^c#292541^
  16. reset=^d^
  17. if [[ $status == "Discharging" ]]; then
  18. ibg=^b#705b86^
  19. elif [[ $status == "Full" ]]; then
  20. ibg=^b#50FA7B^
  21. else
  22. ibg=^b#50FA7B^
  23. fi
  24. if [[ $bat -lt 10 ]]; then
  25. echo "$ibg$tfg $ramp10 $tbg $bat% $reset"
  26. elif [[ $bat -lt 20 ]]; then
  27. echo "$ibg$tfg $ramp20 $tbg $bat% $reset"
  28. elif [[ $bat -lt "30" ]]; then
  29. echo "$ibg$tfg $ramp30 $tbg $bat% $reset"
  30. elif [[ $bat -lt "40" ]]; then
  31. echo "$ibg$tfg $ramp40 $tbg $bat% $reset"
  32. elif [[ $bat -lt "50" ]]; then
  33. echo "$ibg$tfg $ramp50 $tbg $bat% $reset"
  34. elif [[ $bat -lt "60" ]]; then
  35. echo "$ibg$tfg $ramp60 $tbg $bat% $reset"
  36. elif [[ $bat -lt "70" ]]; then
  37. echo "$ibg$tfg $ramp70 $tbg $bat% $reset"
  38. elif [[ $bat -lt "80" ]]; then
  39. echo "$ibg$tfg $ramp80 $tbg $bat% $reset"
  40. elif [[ $bat -lt "90" ]]; then
  41. echo "$ibg$tfg $ramp90 $tbg $bat% $reset"
  42. elif [[ $bat -le "100" ]]; then
  43. echo "$ibg$tfg $ramp100 $tbg $bat% $reset"
  44. fi