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

[Feature] Support condition in listener configuration #94

Open
Diaoul opened this issue Oct 20, 2024 · 0 comments
Open

[Feature] Support condition in listener configuration #94

Diaoul opened this issue Oct 20, 2024 · 0 comments

Comments

@Diaoul
Copy link

Diaoul commented Oct 20, 2024

The goal is to run a condition (or test_cmd) to know if the listener should trigger or not.

Use case: Based on whether my laptop is plugged or on battery I want different behaviors and avoid putting that logic in the on-timeout and on-resume as tests.

Current workaround:
I prefix my on-resume and on-timeout commands:

[ "$(cat /sys/class/power_supply/AC/online)" = "0" ] && brightnessctl ...

However, it's not perfect: I don't want the on-resume to run if in between I've plugged/unplugged my laptop. In other words, if the on-timeout did not trigger because of condition, I don't want the on-resume to run at all.

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

1 participant