From: Christian Heller Date: Mon, 17 Mar 2025 19:41:33 +0000 (+0100) Subject: Improve status bar. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%22https:/validator.w3.org/unset_cookie?a=commitdiff_plain;p=config Improve status bar. --- diff --git a/testing/home/t490s/.nonpath_bins/status.sh b/testing/home/t490s/.nonpath_bins/status.sh index dcc30f1..e3bb5f9 100755 --- a/testing/home/t490s/.nonpath_bins/status.sh +++ b/testing/home/t490s/.nonpath_bins/status.sh @@ -26,7 +26,17 @@ print_bar_element() { } print_online() { - print_bar_element "$(ip -4 addr show scope global | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | head -1)" + show_conn() { + COLOR="${COL_GREEN}" + IP=$(ip --brief addr show | grep "$2" | sed -E 's/ +/\t/g' | cut -f3 | cut -f1 -d'/') + if [ -z "${IP}" ]; then + IP=- + COLOR="${COL_RED}" + fi + print_bar_element "$1:${IP}" "${COLOR}" "$3" + } + show_conn E enp 10 + show_conn W wlp } print_battery() { @@ -55,7 +65,7 @@ print_battery() { } print_temperature() { - COLOR="${COL_WHITE}" + COLOR="${COL_GREEN}" TEMPERATURE=$(cat ${SYSCLASS_DIR}/thermal/thermal_zone0/temp) TEMPERATURE_IN_C=$(printf "%d" $(calc "${TEMPERATURE} // 1000")) if [ $TEMPERATURE_IN_C -gt 85 ]; then