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_
22 #include <gconf/gconf-client.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_decoration_enabled;
51 bool window_keep_below_enabled;
52 bool window_restore_enabled;
53 /* Last saved position of the window. */
56 /* Last saved size of the window. */
59 /* Last saved position of the window divider. */
60 int window_divider_pos;
62 int graph_update_interval;
63 int graph_monitoring_duration;
65 int sensor_values_max_length;
66 int sensor_update_interval;
68 bool menu_bar_disabled;
70 bool unity_launcher_count_disabled;
74 enum temperature_unit temperature_unit;
80 /* Loads psensor configuration */
81 struct config *config_load();
83 void config_save(const struct config *);
85 void config_cleanup();
87 struct color *config_get_sensor_color(const char *sid, const struct color *);
88 void config_set_sensor_color(const char *sid, const struct color *);
90 int config_get_sensor_alarm_high_threshold(const char *);
91 void config_set_sensor_alarm_high_threshold(const char *, int);
93 int config_get_sensor_alarm_low_threshold(const char *);
94 void config_set_sensor_alarm_low_threshold(const char *, int);
96 bool config_get_sensor_alarm_enabled(const char *);
97 void config_set_sensor_alarm_enabled(const char *, bool);
99 bool config_is_sensor_enabled(const char *);
100 void config_set_sensor_enabled(const char *, bool);
102 char *config_get_sensor_name(const char *);
103 void config_set_sensor_name(const char *, const char *);
105 bool config_is_appindicator_enabled(const char *);
106 void config_set_appindicator_enabled(const char *, bool);
108 bool config_is_appindicator_label_enabled(const char *);
109 void config_set_appindicator_label_enabled(const char *, bool);
111 void config_slog_enabled_notify_add(GConfClientNotifyFunc cbk, void *data);
112 bool is_slog_enabled();
114 int config_get_slog_interval();
116 int config_get_sensor_position(const char *);
117 void config_set_sensor_position(const char *, int);
119 char *config_get_notif_script();
120 void config_set_notif_script(const char *);
123 * Returns the user directory containing psensor data (configuration
125 * Corresponds to $HOME/.psensor/
126 * Creates the directory if it does not exist;
127 * Returns NULL if it cannot be determined.
129 const char *get_psensor_user_dir();