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.

45 lines
1.2 KiB

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