added nightlight status indicator

Based on feedback from @pineapples5972 in this comment: https://github.com/LukeSmithxyz/voidrice/pull/1181#issuecomment-1233816668
This commit is contained in:
Kelly Roberts 2022-09-01 07:55:22 +00:00 committed by GitHub
parent c330624dec
commit c5bfdcba4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,9 @@ for battery in /sys/class/power_supply/BAT?*; do
capacity="$(cat "$battery/capacity" 2>&1)" capacity="$(cat "$battery/capacity" 2>&1)"
# Will make a warn variable if discharging and low # Will make a warn variable if discharging and low
[ "$status" = "🔋" ] && [ "$capacity" -le 25 ] && warn="❗" [ "$status" = "🔋" ] && [ "$capacity" -le 25 ] && warn="❗"
# Show nightlight status
colortemp="$(xsct | cut -d' ' -f5)"
[ "$colortemp" -lt 6500 ] && night=" 🌙"
# Prints the info # Prints the info
printf "%s%s%d%%" "$status" "$warn" "$capacity"; unset warn printf "%s%s%d%%%s" "$status" "$warn" "$capacity" "$night"; unset warn
done && printf "\\n" done && printf "\\n"