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.

46 lines
1.3 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #!/bin/bash
  2. source ~/.config/config.env
  3. ramp10=
  4. ramp20=
  5. ramp30=
  6. ramp40=
  7. ramp50=
  8. ramp60=
  9. ramp70=
  10. ramp80=
  11. ramp90=
  12. ramp100=
  13. ac_bat=
  14. ac=ﮣ
  15. if [ "$NO_BAT" = true ] ; then
  16. echo "^c#ebcb8b^$ac^d^"
  17. else
  18. export bat=$(cat /sys/class/power_supply/BAT0/capacity)
  19. export status=$(cat /sys/class/power_supply/BAT0/status)
  20. export plugged=$(cat /sys/class/power_supply/AC/online)
  21. if [[ $plugged == "1" ]]; then
  22. echo "^c#ebcb8b^$ac_bat^d^ $bat%"
  23. elif [[ $bat -lt 10 ]]; then
  24. echo "^c#ebcb8b^$ramp10^d^ $bat% "
  25. elif [[ $bat -lt 20 ]]; then
  26. echo "^c#ebcb8b^$ramp20^d^ $bat% "
  27. elif [[ $bat -lt "30" ]]; then
  28. echo "^c#ebcb8b^$ramp30^d^ $bat% "
  29. elif [[ $bat -lt "40" ]]; then
  30. echo "^c#ebcb8b^$ramp40^d^ $bat% "
  31. elif [[ $bat -lt "50" ]]; then
  32. echo "^c#ebcb8b^$ramp50^d^ $bat% "
  33. elif [[ $bat -lt "60" ]]; then
  34. echo "^c#ebcb8b^$ramp60^d^ $bat% "
  35. elif [[ $bat -lt "70" ]]; then
  36. echo "^c#ebcb8b^$ramp70^d^ $bat% "
  37. elif [[ $bat -lt "80" ]]; then
  38. echo "^c#ebcb8b^$ramp80^d^ $bat% "
  39. elif [[ $bat -lt "90" ]]; then
  40. echo "^c#ebcb8b^$ramp90^d^ $bat% "
  41. elif [[ $bat -le "100" ]]; then
  42. echo "^c#ebcb8b^$ramp100^d^ $bat% "
  43. fi
  44. fi