Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Replace IP address with icon if none is found #384

Closed
akrueger opened this issue Jan 23, 2017 · 9 comments
Closed

Replace IP address with icon if none is found #384

akrueger opened this issue Jan 23, 2017 · 9 comments

Comments

@akrueger
Copy link

I like to have the IP address showing when I'm connected, but it's also valuable for me to see when I've lost a connection.

I don't find the defaultNETWORK_ICON especially helpful except if it were distinguishing wi-fi from ethernet for example (I thought this was the case, but it didn't seem to switch when I went to ethernet).

I was wondering if there was an easy way for me to customize displaying the POWERLEVEL9K_FAIL_ICON when no IP is found and simply displaying the IP when it is.

I have found that I can disable the NETWORK_ICON by setting it to '', but then I just get a blank segment for my IP when I'm not connected.

I saw the prompt_ip function in powerlevel9k.zsh-theme, but didn't think it was wise to edit that directly in the case of updates, etc.

Thanks

@rjorgenson
Copy link
Collaborator

I have this functionality in the recent public_ip segment that I wrote by allowing you to set a POWERLEVEL9K_PUBLIC_IP_NONE variable to display when there is no IP, perhaps that logic can be implemented in the internal IP segment as well?

@akrueger
Copy link
Author

@rjorgenson I didn't find any of those in the repo, or in yours. Where can I find that implementation for the public ip? Thanks

@rjorgenson
Copy link
Collaborator

@akrueger it's in the next branch here.

@akrueger
Copy link
Author

akrueger commented Jan 24, 2017

@rjorgenson ah, I see it now, thanks!

I can't say I follow the implementation perfectly (not much of a shell scripter), but the documentation is quite clear. Is POWERLEVEL9K_PUBLIC_IP_NONE able to be set to FAIL_ICON or does it dynamically change?

It would be great if I had both internal and public IPs and when either or both weren't resolving it would go to FAIL_ICON

@rjorgenson
Copy link
Collaborator

@akrueger That variable can be set to anything, but you'd need to reference fail icon with it's actual code point, rather than FAIL_ICON as that's just what p9k uses to reference that icon in the icons array =]

@akrueger
Copy link
Author

Ok, do you have any notion of when the next release might be? I'm actually more interested in the public IP for VPN purposes. I may end up doing both, but screen real estate is valuable, so perhaps I'll just wait for your inclusion in the next release.

@rjorgenson
Copy link
Collaborator

I do not =/ But you can follow the progress here - https://github.com/bhilburn/powerlevel9k/projects/1

@akrueger
Copy link
Author

Thanks! I'll keep my eye on it

@bhilburn
Copy link
Member

@akrueger - I'm trying to get the release out as soon as I can. Just a matter of working through the last few items. If you want to help, we are always looking for more devs! ;) #371

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants