From b9e63735a3a37c6a81c16628e27de1383ee7cde3 Mon Sep 17 00:00:00 2001 From: Mahesh Asolkar Date: Fri, 22 Jan 2021 20:14:40 -0800 Subject: [PATCH] Better commands for battery and network --- dwm_status.laptop | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dwm_status.laptop b/dwm_status.laptop index b554bb7..25cc211 100755 --- a/dwm_status.laptop +++ b/dwm_status.laptop @@ -4,8 +4,9 @@ VOL=$(amixer get Master | tail -1 | sed 's/.*\[\([0-9]*%\)\].*/\1/') LOCALTIME=$(date +"%Y %h %d %I:%M%p %Z") -IP=$(for i in `ip r`; do echo $i; done | grep -A 1 src | tail -n1) +#IP=$(for i in `ip r`; do echo $i; done | grep -A 1 src | tail -n1) +IP=$(getent ahosts google.com | head -n 1 | awk '{print $1}' | xargs ip route get | head -n 1 | awk '{print $7}') WEATHER=$(weather fips4105192520 | grep Tempera | awk '{print $2}') -BAT=$(acpi -b | awk '{ print $4 " " $5 }' | tr -d ',') +BAT=$(acpi -b | awk '{ print " " $5 }' | tr -d ',') xsetroot -name " 🔊 $VOL | $IP | 🔋 $BAT | ${WEATHER}°F | $LOCALTIME"