mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-24 20:34:57 +00:00
Add local IP support to Linux and Windows
This commit is contained in:
20
fetch
20
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 () {
|
||||
|
||||
Reference in New Issue
Block a user