{"action":"created","issue":{"url":"https://api.github.com/repos/bhilburn/powerlevel9k/issues/157","labels_url":"https://api.github.com/repos/bhilburn/powerlevel9k/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/bhilburn/powerlevel9k/issues/157/comments","events_url":"https://api.github.com/repos/bhilburn/powerlevel9k/issues/157/events","html_url":"https://github.com/bhilburn/powerlevel9k/pull/157","id":118513790,"number":157,"title":"Performance improvement of battery segment on OSX","user":{"login":"dritter","id":1544760,"avatar_url":"https://avatars.githubusercontent.com/u/1544760?v=3","gravatar_id":"","url":"https://api.github.com/users/dritter","html_url":"https://github.com/dritter","followers_url":"https://api.github.com/users/dritter/followers","following_url":"https://api.github.com/users/dritter/following{/other_user}","gists_url":"https://api.github.com/users/dritter/gists{/gist_id}","starred_url":"https://api.github.com/users/dritter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dritter/subscriptions","organizations_url":"https://api.github.com/users/dritter/orgs","repos_url":"https://api.github.com/users/dritter/repos","events_url":"https://api.github.com/users/dritter/events{/privacy}","received_events_url":"https://api.github.com/users/dritter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-11-24T01:43:11Z","updated_at":"2015-11-25T22:49:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bhilburn/powerlevel9k/pulls/157","html_url":"https://github.com/bhilburn/powerlevel9k/pull/157","diff_url":"https://github.com/bhilburn/powerlevel9k/pull/157.diff","patch_url":"https://github.com/bhilburn/powerlevel9k/pull/157.patch"},"body":"I reworked the battery segment for some performance. Mainly this performance is better by avoiding ruby for simple calculations and pulling the data in over and over.\r\n\r\nIMHO the linux part could need some more structure as well. I'll do that if I have more time.\r\n\r\n/cc @rjorgenson @tritlo"},"comment":{"url":"https://api.github.com/repos/bhilburn/powerlevel9k/issues/comments/159749131","html_url":"https://github.com/bhilburn/powerlevel9k/pull/157#issuecomment-159749131","issue_url":"https://api.github.com/repos/bhilburn/powerlevel9k/issues/157","id":159749131,"user":{"login":"rjorgenson","id":44096,"avatar_url":"https://avatars.githubusercontent.com/u/44096?v=3","gravatar_id":"","url":"https://api.github.com/users/rjorgenson","html_url":"https://github.com/rjorgenson","followers_url":"https://api.github.com/users/rjorgenson/followers","following_url":"https://api.github.com/users/rjorgenson/following{/other_user}","gists_url":"https://api.github.com/users/rjorgenson/gists{/gist_id}","starred_url":"https://api.github.com/users/rjorgenson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjorgenson/subscriptions","organizations_url":"https://api.github.com/users/rjorgenson/orgs","repos_url":"https://api.github.com/users/rjorgenson/repos","events_url":"https://api.github.com/users/rjorgenson/events{/privacy}","received_events_url":"https://api.github.com/users/rjorgenson/received_events","type":"User","site_admin":false},"created_at":"2015-11-25T22:49:39Z","updated_at":"2015-11-25T22:49:39Z","body":"@dritter Wouldn't that only reset the color to your terminals default, instead of being what the foreground color is set to? Maybe if you thought about it as overriding the color of the icon output with the state of the battery instead of overriding the text output color? That was my original goal when I wrote it, to fit in with the way the rest of the segments handle color, but enable the battery icon color to be set based on the state. The only other way I could think of to do it was to build the option into the print_icon function, which would have made it more general and usable by all segments, but it would then have to keep track somehow of the color that was set before it to set it back to that after printing the icon and I couldn't find a good way to do that. Any thoughts on that approach?"}}