From 159754c1cd7d2a86d5ba37746f8baeaf06e34123 Mon Sep 17 00:00:00 2001 From: Jon Lund Steffensen Date: Fri, 30 May 2014 00:16:35 +0200 Subject: redshift: Add hooks for user actions on period switch Hooks are executable scripts in ~/.config/redshift/hooks/ that are run when a certain event happens. The first parameter to the script indicates the event and further parameters may indicate more details about the event. The event "period-changed" is indicated when the period changes ("night", "daytime", "transition"). The second parameter is the old period and the third is the new period. The event is signaled when Redshift starts up with the old period set to "none". --- src/hooks.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/hooks.h (limited to 'src/hooks.h') diff --git a/src/hooks.h b/src/hooks.h new file mode 100644 index 0000000..fd1c2f0 --- /dev/null +++ b/src/hooks.h @@ -0,0 +1,29 @@ +/* hooks.h -- Hooks triggered by events + This file is part of Redshift. + + Redshift is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Redshift is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Redshift. If not, see . + + Copyright (c) 2014 Jon Lund Steffensen +*/ + +#ifndef REDSHIFT_HOOKS_H +#define REDSHIFT_HOOKS_H + +#include "redshift.h" + +void hooks_signal_period_change(period_t prev_period, + period_t period); + + +#endif /* ! REDSHIFT_HOOKS_H */ -- cgit v1.2.3-70-g09d2