Add IP module

This commit is contained in:
Emily Daemon 2022-04-09 12:57:55 +03:00
parent 2b07abaa42
commit 1b59e123c0
2 changed files with 5 additions and 0 deletions

View File

@ -16,4 +16,5 @@
#module_loadavg "Load Avg.: " " | " #module_loadavg "Load Avg.: " " | "
#module_weather "Weather: " " | " #module_weather "Weather: " " | "
#module_du "Disk Usage: " " | " #module_du "Disk Usage: " " | "
#module_ip "IP: " " | "
module_date "Date: " "" module_date "Date: " ""

View File

@ -41,3 +41,7 @@ module_weather() {
module_du() { module_du() {
export bar="${bar}${1}$(df -T / | awk '{if (NR!=1) {print $6}}')${2}" 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}"
}