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 threshold-based script invocation #46

Merged
merged 6 commits into from Oct 28, 2017

Conversation

dvejmz
Copy link
Contributor

@dvejmz dvejmz commented Oct 15, 2017

This PR provides a working MVP solution to close #25.

The following functionality has been added:

  • Created application config directory in $XDG_CONFIG_HOME/s-tui or ~/.config/s-tui if $XDG_CONFIG_HOME is not set.
  • Create hooks.d directory in app config location to add threshold scripts.
  • Add base logic for threshold-based script invocation in the form of hooks
    • Create Hook base class. This should become the base class for all types of hooks.
    • Create ScriptHook wrapper class to run shell scripts located under hooks.d
    • Add functions to Source parent class so that hooks can be added to any source
  • Add TemperatureSource script hook.
  • Update READMEs with user instructions on how to add their own scripts

Enhancements for future iterations not included in this PR:

  • Ability to change default config directory
  • Ability to change hook invocation timeouts (right now it defaults to 30 seconds)
  • Add hooks to more sources

@amanusk
Copy link
Owner

amanusk commented Oct 25, 2017

Thank you for your contribution.
This looks great. I was thinking to add a config file. It will be good bases to also configure s-tui itself. (e.g what sensors/graphs to show).
I will test this on a few systems before approving

@amanusk amanusk closed this Oct 28, 2017
@amanusk amanusk reopened this Oct 28, 2017
@amanusk amanusk merged commit 565e9d4 into amanusk:master Oct 28, 2017
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.

Add script invocation when crossing thresholds
2 participants