From c5bfdcba4ce1ee5f325baa8c1655833402aedc54 Mon Sep 17 00:00:00 2001 From: Kelly Roberts <105584129+bubstance@users.noreply.github.com> Date: Thu, 1 Sep 2022 07:55:22 +0000 Subject: [PATCH] added nightlight status indicator Based on feedback from @pineapples5972 in this comment: https://github.com/LukeSmithxyz/voidrice/pull/1181#issuecomment-1233816668 --- .local/bin/statusbar/sb-battery | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-battery b/.local/bin/statusbar/sb-battery index 69b2f41c..89d5846f 100755 --- a/.local/bin/statusbar/sb-battery +++ b/.local/bin/statusbar/sb-battery @@ -33,6 +33,9 @@ for battery in /sys/class/power_supply/BAT?*; do capacity="$(cat "$battery/capacity" 2>&1)" # Will make a warn variable if discharging and low [ "$status" = "🔋" ] && [ "$capacity" -le 25 ] && warn="❗" + # Show nightlight status + colortemp="$(xsct | cut -d' ' -f5)" + [ "$colortemp" -lt 6500 ] && night=" 🌙" # 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"