diff --git a/fetch b/fetch index 77ca216e..d4ecc3a7 100755 --- a/fetch +++ b/fetch @@ -1335,6 +1335,26 @@ getbattery () { # }}} +# IP Address {{{ + +getlocalip () { + case "$os" in + "Linux") + localip="$(ip route get 1 | awk '{print $NF;exit}')" + ;; + + "Windows") + localip="$(ipconfig | awk -F ': ' '/IPv4 Address/ {printf $2}')" + ;; + + *) + localip="Unknown" + ;; + esac +} + +# }}} + # Birthday {{{ getbirthday () {