diff --git a/config.sh b/config.sh index 11e8a23..bc87d89 100755 --- a/config.sh +++ b/config.sh @@ -16,4 +16,5 @@ #module_loadavg "Load Avg.: " " | " #module_weather "Weather: " " | " #module_du "Disk Usage: " " | " +#module_ip "IP: " " | " module_date "Date: " "" diff --git a/modules.sh b/modules.sh index c3f47df..6fc1c3a 100755 --- a/modules.sh +++ b/modules.sh @@ -41,3 +41,7 @@ module_weather() { module_du() { export bar="${bar}${1}$(df -T / | awk '{if (NR!=1) {print $6}}')${2}" } + +module_ip() { + export bar="${bar}${1}$(ip -f inet a | awk '/inet / { print $2 }' | tail -n 1 | sed 's/\/.*//')${2}" +}