Giter VIP home page Giter VIP logo

Comments (9)

obihann avatar obihann commented on August 23, 2024

@jhersh Thanks for pointing this out. We changed how we poll the battery to speed the startup time, and since I personally don't have a mac without a battery this slipped by me. I'll try to get a fix out for you this week.

Thanks!

from archey-osx.

childnode avatar childnode commented on August 23, 2024

yes, confirm, my pr #34 did this, you can easily test this by "mocking" output:
childnodeContribArch@11c680a#diff-eb0567f739a3de3220b8e9fa66e91e97R79

echo "fooBar" | awk '$1~/Capacity/{c[$1]=$3} END{OFMT="%.2f%%"; max=c["\"MaxCapacity\""]; print (max>0? 100*c["\"CurrentCapacity\""]/max: "?")}'
will result in ? as mentioned by @jhersh

that's the result blind-copy other guys code from forums without really reading it ;)
print (max>0? 100*c["\"CurrentCapacity\""]/max: "?")
better
if (max>0) { print 100*c["\"CurrentCapacity\""]/max;}

that's where the ? comes from.

if you @obihann refer to this bug on 78c3df3
=> nope, you will not fix anything with this ;p why do you think formatter change %.2f%% to %.2f% is causing this or will change anything? you'll just get the next bug,

fixed in my develop

from archey-osx.

obihann avatar obihann commented on August 23, 2024

@childnode if you check now I am determining when to show / hide the battery display, we check if the value is empty, but your code would display a % sign with no value when no battery was present. By removing the % until we print then we can properly check if the value was empty and not display it... That being said your pull request looks good as well, so if you can simply resolve the merge conflicts I don't see why we can't get @jhersh to test it out then mark it resolved and release it.

from archey-osx.

childnode avatar childnode commented on August 23, 2024

hi @obihann

if you check now
what? => 78c3df3

and no, the code will not display % sign if no value was parsed when no battery was present.
just tested in an VirtualMachine ...
The OFMT alias numeric output formatter just formats what is printed, if nothing is printed if no MaxCapacity is found in ioreg, awk must not print "?". That's it!

the "merge conflict" resulted in disregarding your commit 78c3df3.
ommit your change, that's it

HINT: for next release, you should check your differences between master and develop, e.g. README.md which is outdated in develop branch. perhaps you might check the git-flow workflow. it's easy but solves several common workflow problems

from archey-osx.

jhersh avatar jhersh commented on August 23, 2024

With 78c3df3 the output is Battery: ?%

from archey-osx.

obihann avatar obihann commented on August 23, 2024

@childnode @jhersh Sorry for the delay, jumping on this now. I've merged your PR into develop and should have a 1.6 release later this week with it.

from archey-osx.

CamJN avatar CamJN commented on August 23, 2024

Any news on that 1.6 release? I'm a no-battery user as well (actually a laptop with the battery removed) and would appreciate this improvement.

from archey-osx.

obihann avatar obihann commented on August 23, 2024

I believe we good, latest code via master should contain the fixes.

from archey-osx.

obihann avatar obihann commented on August 23, 2024

This is now in 1.6.0-pr https://github.com/obihann/archey-osx/releases/tag/1.6.0-pr

from archey-osx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.