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

label-warn for other modules #570

Closed
noctuid opened this issue May 9, 2017 · 7 comments · Fixed by #2199
Closed

label-warn for other modules #570

noctuid opened this issue May 9, 2017 · 7 comments · Fixed by #2199

Comments

@noctuid
Copy link

noctuid commented May 9, 2017

I think it would make sense to be able to have warning thresholds for the memory, cpu, and battery modules as well.

@jaagr
Copy link
Member

jaagr commented May 10, 2017

You could already achieve the same behavior by using <ramp> if the module have support for it. For example:

[module/cpu]
type = internal/cpu
format = <ramp-load>

ramp-load-0 = low
ramp-load-0-foreground = #0f0
ramp-load-1 = medium
ramp-load-1-foreground = #ff0
ramp-load-2 = high
ramp-load-2-foreground = #f00

# or

ramp-load-0 = normal
ramp-load-1 = normal
ramp-load-2 = normal
ramp-load-3 = warning

@noctuid
Copy link
Author

noctuid commented May 10, 2017

I tried that initially, but it doesn't seem possible to use %percentage% outside of the label. Also the memory module doesn't have <ramp>, and it would be more precise and less verbose to be able to use a specific value for a threshold.

@boydthomson
Copy link

noctuid, did you find a way to achieve this? I'm looking for the same feature. Would be great to have greater visual distraction when my RAM usage is getting up there.

@juliancoffee
Copy link

It is a great idea. I implemented it for memory in #2142, and want to implement it for CPU as well.

@venteto
Copy link

venteto commented Sep 30, 2020

Love this idea, I also would like to be able to set arbitrary warning thresholds (e.g. RAM and swap percentages, even network download/upload speeds, and perhaps eventually disk read/write speeds if a disk I/O module is implemented) and thus conditional label warn foreground colors. Pretty much everything in my polybar is just colored an unobtrusive white and only changes color IF something actually changes, e.g., I have a custom script module that only changes to red if my ISP has changed my WAN ipv4 and/or ipv6 address(es).

@quandangv
Copy link
Contributor

I'm working on this feature. It has been implemented succesfully on the memory, cpu and filesystem modules, only the battery module left and I will upload the code.

But I was wondering, do you need a warning on the alsa/pulseaudio module? Maybe for protection from loud sounds? If so, I will implement this feature on those modules too.

@patrick96
Copy link
Member

Implemented in #2199

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

Successfully merging a pull request may close this issue.

7 participants