-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathlightum.h
71 lines (62 loc) · 1.98 KB
/
lightum.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include <X11/Xlib.h>
#include <gio/gio.h>
#define CONFIG_PATH ".config/lightum/"
#define CONFIG_FILE "lightum.conf"
#define PID_FILE "lightum.pid"
#ifndef FALSE
#define FALSE (0)
#endif
#ifndef TRUE
#define TRUE (!FALSE)
#endif
/* config file */
typedef struct {
int manualmode;
int queryscreensaver;
int maxbrightness;
int minbrightness;
int polltime;
int idleoff;
int ignoreuser;
int minbacklight;
int maxbacklight;
int screenidle;
int workmode;
int ignoresession;
int fulldim;
} conf_data;
/* configfile.c */
conf_data config_parse();
int file_exists(char* file);
char* default_config_dir();
int create_config_dir(char* path);
/* functions.c */
int get_keyboard_brightness_value();
int get_light_sensor_value();
int get_screen_backlight_value();
int dbus_to_acpi_backlight(int backlight);
int acpi_to_dbus_backlight(int backlight);
int set_screen_backlight_value(int backlight, int backend);
int calculate_keyboard_brightness_value(int light, int maxlight, int minlight);
int calculate_screen_backlight_value(int light, int maxbacklight, int minbacklight);
void fading(int from, int to);
void backlight_fading(int from, int to, int backend);
float get_session_idle_time(Display *display);
void signal_installer();
int remove_pid_file();
int create_pid_file();
/* dbus.c */
GDBusConnection* get_dbus_message_bus(GBusType *bus_type);
int get_screensaver_active();
int set_keyboard_brightness_value(int brightness);
int dbus_get_screen_backlight_value();
int dbus_set_screen_backlight_value_gnome(int backlight);
int dbus_set_screen_backlight_value_kde(int backlight);
int dbus_set_screen_backlight_value(int backlight, int backend);
/* dbus-session.c */
GDBusConnection* get_dbus_connection();
GDBusProxy* get_dbus_proxy_manager(GDBusConnection *connection);
GDBusProxy* get_dbus_proxy_session(GDBusConnection *connection, GDBusProxy *proxy_manager);
int get_session_active (GDBusProxy *proxy_session);
extern int get_screen_xbacklight_value();
extern int set_screen_xbacklight_value(int backlight);