aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbar.sh2
-rwxr-xr-xmodules/localip4
2 files changed, 4 insertions, 2 deletions
diff --git a/bar.sh b/bar.sh
index 1a98bf1..a600381 100755
--- a/bar.sh
+++ b/bar.sh
@@ -47,7 +47,7 @@ run_module()
fi
if [[ "$out" = " " ]]; then
- echo " " > "$OUTPUT_CACHE$module"
+ echo "" > "$OUTPUT_CACHE$module"
elif [[ ! "$out" = "" ]]; then
out="$out$SEPARATOR."
echo "$out" > "$OUTPUT_CACHE$module"
diff --git a/modules/localip b/modules/localip
index 39629db..91a74c0 100755
--- a/modules/localip
+++ b/modules/localip
@@ -6,7 +6,9 @@ PREFIX='ﯱ '
get_local_ip()
{
- echo "$PREFIX$(hostname -i)"
+ IP=$(ip addr | grep -e "inet " | awk 'NR==2' | sed 's/^.*inet.//g; s/\/.*//g')
+
+ echo "$PREFIX$IP"
}
get_local_ip