Comments (9)
@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.
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.
@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.
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.
With 78c3df3 the output is Battery: ?%
from archey-osx.
@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.
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.
I believe we good, latest code via master should contain the fixes.
from archey-osx.
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)
- archey help misalignment HOT 2
- i can't remaster automatically manually HOT 4
- π%%
- add local machine ip addressοΌ HOT 2
- Calculating disk usage - hangs for ~10 seconds
- eth0.me is unreachable HOT 9
- New release? HOT 1
- binary operator expected Error when run "archey"
- eth0.me is down HOT 6
- Archey wont launch on startup of my terminal HOT 1
- It seems that archey expects system awk but system sed
- archer doesn't show IP HOT 3
- There isn't a --localip option, but the README says there is HOT 6
- Stuck, cannot get IP address HOT 1
- Turn off the Apple HOT 1
- Archey Hangs HOT 3
- "random" logofile
- Previous site to get IP info has moved HOT 2
- IP address weird message HOT 2
- machdep: class is not implemented
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from archey-osx.