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

1.5 IP timeout & Battery #17

Closed
jhersh opened this issue Oct 7, 2015 · 12 comments
Closed

1.5 IP timeout & Battery #17

jhersh opened this issue Oct 7, 2015 · 12 comments

Comments

@jhersh
Copy link

jhersh commented Oct 7, 2015

Thanks for a really great utility! 👍 I wanted to report 2 issues with 1.5:

% archey -c

                 ###                  User: jh
               ####                   Hostname: jhmp
               ###                    Distro: OS X 10.11.1
       #######    #######             Kernel: Darwin
     ######################           Uptime: 16:44  up 8 days,  3:36, 4 users, load averages: 1.64 1.53 1.58
    #####################             Shell: /usr/local/bin/zsh
    ####################              Terminal: xterm-256color iTerm.app
    ####################              Packages: 7
    #####################             CPU: Intel Xeon CPU E5-1680 v2 @ 3.00GHz
     ######################           Memory: 32 GB
      ####################            Disk: 36%
        ################              Battery:
         ####     #####               IP Address: ;; connection timed out; no servers could be reached

🔋🚫 I'm on a Mac Pro, which doesn't have a battery, so it seems peculiar to include a blank battery line here.

⌛ archey now takes about 10 seconds to execute because the IP fetch times out. I've verified that the underlying command archey is using (dig +short myip.opendns.com @resolver1.opendns.com) is the cause of this delay, and that command still times out and prints the above message when used alone. It may be that my current network is blocking or filtering opendns, but even if not, this network request is still likely to be the slowest part about running archey. Perhaps it's worth adding an optional switch to disable the IP address fetch?

@obihann
Copy link
Owner

obihann commented Oct 8, 2015

Thanks for noticing this, I'll look into both and try to get them taken care of before 1.5.x is released into homebrew.

@obihann obihann added the bug label Oct 8, 2015
@obihann obihann added the 1.5.0 label Oct 15, 2015
@obihann obihann modified the milestone: 1.5.1 Oct 15, 2015
@obihann obihann self-assigned this Oct 15, 2015
obihann pushed a commit that referenced this issue Oct 30, 2015
…, if battery is empty it doesn't effect layout
@obihann
Copy link
Owner

obihann commented Oct 30, 2015

@jhersh Could you do me a favour and verify that 5194561 hides the battery field for you without causing any new issues? I don't have a machine without a battery so I can only make an assumption this will work. Thanks!

edit: changed to a different commit

@jhersh
Copy link
Author

jhersh commented Oct 30, 2015

@obihann Thanks for checking into this! Unfortunately it's still there:

[0] % git rev-parse HEAD
fa463d4c9d3b213cb9b55c231c6eb3d090c278a6

[0] % gb
* master

[0] % bin/archey -o

                 ###                  User: jh
               ####                   Hostname: jhmp
               ###                    Distro: OS X 10.11.1
       #######    #######             Kernel: Darwin
     ######################           Uptime: 8 days
    #####################             Shell: /usr/local/bin/zsh
    ####################              Terminal: xterm-256color iTerm.app
    ####################              Packages: 7
    #####################             CPU: Intel Xeon CPU E5-1680 v2 @ 3.00GHz
     ######################           Memory: 32 GB
      ####################            Disk: 44%
        ################              Battery:
         ####     #####

One other minor thing I noticed:

[0] % bin/archey -co
Unknown argument: -co
For help, use: bin/archey --help

Looks like it wants archey -c -o instead.

@obihann
Copy link
Owner

obihann commented Oct 30, 2015

👎 thats too bad. Could you run ioreg -l | grep -i capacity | tr '\n' ' | ' | awk '{printf("%.2f%%", $10/$5 * 100)}' and paste me the output? Then I should know exactly what users see when they have no battery, and I can filter it from there. Thanks.

@jhersh
Copy link
Author

jhersh commented Oct 30, 2015

No output ("capacity" does not appear anywhere in ioreg -l)

@obihann
Copy link
Owner

obihann commented Oct 30, 2015

I think I see it now! I should have this fixed shortly.

@obihann
Copy link
Owner

obihann commented Oct 30, 2015

6050fbc should fix this, let me know if not 👍

@jhersh
Copy link
Author

jhersh commented Oct 30, 2015

👍🆒💯

@obihann
Copy link
Owner

obihann commented Oct 30, 2015

Sweet! Thanks.

@nilstgmd
Copy link

thanks for resolving the battery issue, any news on the IP fetching? I have the exact problem when using the corporate wireless network. Thx

@obihann
Copy link
Owner

obihann commented Oct 30, 2015

@nilstgmd I added two features that are now in master and 1.5.1 PR, one is the addition of a -o flag that disables the IP check, the other is caching of the IP. Basically we store your IP in ~/.archey-ip and next time we load if that file is less than 6 hours old we just read it instead of checking again.

@nilstgmd
Copy link

@obihann Great 👍🏿 Thanks for fixing this :shipit:

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

No branches or pull requests

3 participants