[ "$(command -v polybar)" ] || return 0

# export BATTERY_ADAPTER="$(
#   grep -E -l 'Mains' '/sys/class/power_supply/'*'/type' \
#   | head -n 1 \
#   | sed 's|.*/\(.\+\)/type$|\1|'
# )"
# export BATTERY_BATTERY="$(
#   grep -E -l 'Battery' '/sys/class/power_supply/'*'/type' \
#   | head -n 1 \
#   | sed 's|.*/\(.\+\)/type$|\1|'
# )"
export TEMPERATURE_THERMAL_ZONE="$(
  grep -E -l 'cpu|x86' '/sys/class/thermal/thermal_zone'*'/type' 2> /dev/null \
  | head -n 1 \
  | sed 's|.*\([0-9]\+\)/type$|\1|'
)"
export BACKLIGHT_CARD="$(
  grep -E -l 'raw' '/sys/class/backlight/'*'/type' 2> /dev/null \
  | head -n 1 \
  | sed 's|.*/\(.\+\)/type$|\1|'
)"

polybar --quiet --reload top-noshadow &
polybar --quiet --reload bottom-noshadow &
