Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print last updated time and battery percentage onto the dashboard locally #13

Open
coder543 opened this issue Feb 9, 2021 · 2 comments

Comments

@coder543
Copy link

coder543 commented Feb 9, 2021

Just an idea, but it would probably be nice to be able to see the battery percentage on the kindle dashboard... at which point, I thought "why not have the last update time shown as well?"

I added this to the refresh_dashboard function locally:

/usr/sbin/eips 1 39 "last update: $(date -Iminutes) battery: $(gasgauge-info -c | sed 's/%//g')"

Unfortunately, the built-in busybox date utility is extremely limited, so this is printing in UTC time (and not in a very nice format to begin with) and I also discovered that eips can't print the % symbol, apparently, so I'm using sed to strip that out.

Obviously a lot of room for improvement, which is why I didn't open a PR, but I figured I'd at least mention the idea.

@pascalw
Copy link
Owner

pascalw commented Feb 12, 2021

Hey @coder543 I looked into this as well. The downside of writing the battery percentage to the screen like this is that the font will most likely not match the other content on the dashboard. Depending on your backend you might be able to include the percentage in a request header and render it into the dashboard image, something like this:

"$(dirname "$0")/../ht" -d -q -o "$1" get \
https://raw.githubusercontent.com/pascalw/kindle-dash/master/example/example.png \
"X-Kindle-Battery: $(gasgauge-info -c)"

I'm planning to add some more 'tips and tricks' to the README, to document these kinds of us useful things you can do in the local scripts. Both methods (writing the stats locally and the header approach) could be documented there.

@gandalfk7
Copy link

Just an idea, but it would probably be nice to be able to see the battery percentage on the kindle dashboard... at which point, I thought "why not have the last update time shown as well?"

I added this to the refresh_dashboard function locally:

/usr/sbin/eips 1 39 "last update: $(date -Iminutes) battery: $(gasgauge-info -c | sed 's/%//g')"

Unfortunately, the built-in busybox date utility is extremely limited, so this is printing in UTC time (and not in a very nice format to begin with) and I also discovered that eips can't print the % symbol, apparently, so I'm using sed to strip that out.

Obviously a lot of room for improvement, which is why I didn't open a PR, but I figured I'd at least mention the idea.

thank you,
that was exactly what I was looking for the testing and debugging phase!

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

No branches or pull requests

3 participants