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 support for conditional formatting #23

Open
domsson opened this issue Dec 10, 2019 · 0 comments
Open

Add support for conditional formatting #23

domsson opened this issue Dec 10, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@domsson
Copy link
Owner

domsson commented Dec 10, 2019

Currently, the biggest disadvantage of succade + lemonbar over other solutions, like polybar, is that it isn't possible to have conditional formatting. For example, you might want to have the CPU temperature string be displayed in blue for low temperatures, yellow for mid-range temperatures and red for high temperatures. We can't do this at the moment.

Here is an idea of how this could be implemented:

  • The configuration files for blocks (or a global config, doesn't matter) could make use of INI sections to list alternative settings. Each section would denote a mode of the block.
  • Blocks could print mode change requests to stderr, and succade would then make use of the appropriate config section of that block.

Example block config:

[temperature:default]
bin = "temps -m"
foreground = "#ffff00"

[temperature:low]
foreground = "#0000ff"

[temperature:high]
foreground = "#ff0000"

Example stderr output of temps -m when a certain temperature change is detected:

@mode:high
@domsson domsson added the enhancement New feature or request label Dec 10, 2019
@domsson domsson self-assigned this Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant