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

Add icons option to Disk Space block #714

Merged
merged 9 commits into from
Jun 13, 2020
Merged

Conversation

jamesmcm
Copy link
Contributor

Adds icons option to use hard disk icon instead of alias in the DiskSpace block.

Tested with FontAwesome4 (but I looked up glyph values for the others, to find comparable icons).

This is my first PR, please let me know if there is anything else to check!

Adds icons option to use hard disk icon instead of alias in the Disk
Space block.

Tested with FontAwesome4.
@ammgws
Copy link
Collaborator

ammgws commented Jun 1, 2020

Maybe we could add a format string instead and have qualifiers {icon}, {alias}, {path}, {available} etc.

@jamesmcm
Copy link
Contributor Author

jamesmcm commented Jun 1, 2020

Sure, is there another block which has an example of this?

@ammgws
Copy link
Collaborator

ammgws commented Jun 1, 2020

Search blocks.md for "format", there are a few that could be used as a reference.

@ammgws
Copy link
Collaborator

ammgws commented Jun 2, 2020

Let me know if you need some help

@jamesmcm
Copy link
Contributor Author

jamesmcm commented Jun 3, 2020

@ammgws done 🙂

Example:
example

I also made some changes to the way the alert state is triggered too, to allow for triggering on an absolute amount used, etc.

@jamesmcm
Copy link
Contributor Author

jamesmcm commented Jun 3, 2020

@ammgws the only thing I dislike is that the 2 decimal places is hardcoded in, rather than being part of FormatTemplate, at the moment I see it only pushes the pre-formatted values matching keys:

But maybe that could be extended to allow for stuff like {free:.0} etc. in the config.

@GladOSkar
Copy link
Contributor

I was also wondering if decimal control could be integrated into the format string.

When thinking about things like the net or the speedtest block, it would be neat to be able to define the precision separately for the different displayed values. Ideally the syntax would allow to define all 3 arguments of the format_speed() function added in #704 / #707, like for example

Free: {free:3:G:B} for Free: 21.9GB

or

Uplink: {up:2:M:b}/s for Uplink: 50Mb/s

blocks.md Outdated Show resolved Hide resolved
@jamesmcm
Copy link
Contributor Author

jamesmcm commented Jun 9, 2020

@ammgws the above issues are fixed 🙂

@ammgws
Copy link
Collaborator

ammgws commented Jun 9, 2020

What's going on with that diff for blocks.md?

@jamesmcm
Copy link
Contributor Author

Oops, looks like it changed it to UNIX line endings, I can switch it back tonight, or we could just swap it to that like the rest of the files are.

@jamesmcm
Copy link
Contributor Author

@ammgws so to confirm shall I switch it back to DOS line endings, or shall we just convert it to UNIX line endings like the rest of the files?

@ammgws
Copy link
Collaborator

ammgws commented Jun 11, 2020

Actually could you change it back for now? After this is merged submit another PR to fix the line endings.

@jamesmcm
Copy link
Contributor Author

@ammgws done :)

blocks.md Outdated Show resolved Hide resolved
@ammgws
Copy link
Collaborator

ammgws commented Jun 13, 2020

Thanks!

@ammgws ammgws merged commit 8074b0b into greshake:master Jun 13, 2020
@GladOSkar GladOSkar mentioned this pull request Jun 19, 2020
4 tasks
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

Successfully merging this pull request may close these issues.

None yet

3 participants