Open AlvaroBernalG opened 6 years ago
I could see this being useful. Are you accomplishing this already yourself?
The local IP would need to know which interface you want to show as there may be many local IPs. But that is feasible as an argument to the segment.
Are you accomplishing this already yourself?
Yes. I currently have a brittle solution that I am trying to improve. I'll make a PR as soon as I finish it.
Regarding the external IP, we are going to need to use an external service that returns the external ip.
Any preferences for a particular service? I was thinking on using https://www.ipify.org/ from https://github.com/rdegges/ipify-api.
What do you think?
I do not have a preference. My standard way of getting my IP is
/usr/bin/dig +short myip.opendns.com @resolver1.opendns.com
But this would rely on the dig
command existing, which it wouldn't on windows. So ipify
would probably be a better option. This segment would be rather slow since it's making an HTTP request. I wonder if we can intelligently cache it. Maybe only every X times the prompt is shown should it actually make a request.
Hello good people of powerline-shell,
Would it be possible to add local IP and external IP as segments ?
As you can see , it becomes quite useful when dealing with docker instances.
Kind Regards, Alvaro