Skip to content

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