2 * Copyright (C) 2010-2014 jeanfi@gmail.com
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 #ifndef _PSENSOR_CONFIG_H_
20 #define _PSENSOR_CONFIG_H_
27 enum temperature_unit {
32 enum sensorlist_position {
33 SENSORLIST_POSITION_RIGHT,
34 SENSORLIST_POSITION_LEFT,
35 SENSORLIST_POSITION_TOP,
36 SENSORLIST_POSITION_BOTTOM
40 struct color *graph_bgcolor;
41 struct color *graph_fgcolor;
43 double graph_bg_alpha;
45 bool alpha_channel_enabled;
47 /* Position of the sensors list table */
48 enum sensorlist_position sensorlist_position;
50 bool window_keep_below_enabled;
51 bool window_restore_enabled;
52 /* Last saved position of the window. */
55 /* Last saved size of the window. */
58 /* Last saved position of the window divider. */
59 int window_divider_pos;
61 int graph_update_interval;
62 int graph_monitoring_duration;
64 int sensor_values_max_length;
65 int sensor_update_interval;
67 bool menu_bar_disabled;
69 bool unity_launcher_count_disabled;
73 enum temperature_unit temperature_unit;
79 /* Loads psensor configuration */
80 struct config *config_load(void);
82 void config_save(const struct config *);
84 void config_cleanup(void);
86 GdkRGBA *config_get_sensor_color(const char *);
87 void config_set_sensor_color(const char *, const GdkRGBA *);
89 bool config_get_sensor_alarm_high_threshold(const char *, double *);
90 void config_set_sensor_alarm_high_threshold(const char *, int);
92 bool config_get_sensor_alarm_low_threshold(const char *, double *);
93 void config_set_sensor_alarm_low_threshold(const char *, int);
95 bool config_get_sensor_alarm_enabled(const char *);
96 void config_set_sensor_alarm_enabled(const char *, bool);
98 bool config_is_sensor_graph_enabled(const char *);
99 void config_set_sensor_graph_enabled(const char *, bool);
101 char *config_get_sensor_name(const char *);
102 void config_set_sensor_name(const char *, const char *);
104 bool config_is_appindicator_enabled(const char *);
105 void config_set_appindicator_enabled(const char *, bool);
107 bool config_is_appindicator_label_enabled(const char *);
108 void config_set_appindicator_label_enabled(const char *, bool);
110 bool is_slog_enabled(void);
111 void config_set_slog_enabled_changed_cbk(void (*)(void *), void *);
113 int config_get_slog_interval(void);
115 bool config_is_smooth_curves_enabled(void);
116 void config_set_smooth_curves_enabled(bool);
118 int config_get_sensor_position(const char *);
119 void config_set_sensor_position(const char *, int);
121 char *config_get_notif_script(void);
122 void config_set_notif_script(const char *);
124 bool config_is_sensor_enabled(const char *sid);
125 void config_set_sensor_enabled(const char *sid, bool enabled);
127 bool config_is_lmsensor_enabled(void);
128 void config_set_lmsensor_enable(bool);
130 bool config_is_gtop2_enabled(void);
131 void config_set_gtop2_enable(bool);
133 bool config_is_udisks2_enabled(void);
134 void config_set_udisks2_enable(bool);
136 bool config_is_hddtemp_enabled(void);
137 void config_set_hddtemp_enable(bool);
139 bool config_is_libatasmart_enabled(void);
140 void config_set_libatasmart_enable(bool);
142 bool config_is_nvctrl_enabled(void);
143 void config_set_nvctrl_enable(bool);
145 bool config_is_atiadlsdk_enabled(void);
146 void config_set_atiadlsdk_enable(bool);
148 int config_get_sensor_unit(void);
150 double config_get_default_high_threshold_temperature(void);
152 bool config_is_window_decoration_enabled(void);
153 void config_set_window_decoration_enabled(bool);
156 * Returns the user directory containing psensor data (configuration
158 * Corresponds to $HOME/.psensor/
159 * Creates the directory if it does not exist;
160 * Returns NULL if it cannot be determined.
162 const char *get_psensor_user_dir(void);
164 void config_sync(void);
166 GSettings *config_get_GSettings(void);