Allow clicking and mousewheeling on the battery panel
This commit is the same as vimishor's original [*] except that I have
added middle-click and up/down mousewheel actions. In order to fix a
ftbs I also added guards to panel.c, panel.h & tint.c
The following configuration settings have been created :-
battery_lclick_command
battery_mclick_command
battery_rclick_command
battery_uwheel_command
battery_dwheel_command
[*] c78732c46a
This commit is contained in:
30
src/config.c
30
src/config.c
@@ -349,6 +349,36 @@ void add_entry (char *key, char *value)
|
||||
battery_low_status = atoi(value);
|
||||
if(battery_low_status < 0 || battery_low_status > 100)
|
||||
battery_low_status = 0;
|
||||
#endif
|
||||
}
|
||||
else if (strcmp(key, "battery_lclick_command") == 0) {
|
||||
#ifdef ENABLE_BATTERY
|
||||
if (strlen(value) > 0)
|
||||
battery_lclick_command = strdup(value);
|
||||
#endif
|
||||
}
|
||||
else if (strcmp(key, "battery_mclick_command") == 0) {
|
||||
#ifdef ENABLE_BATTERY
|
||||
if (strlen(value) > 0)
|
||||
battery_mclick_command = strdup(value);
|
||||
#endif
|
||||
}
|
||||
else if (strcmp(key, "battery_rclick_command") == 0) {
|
||||
#ifdef ENABLE_BATTERY
|
||||
if (strlen(value) > 0)
|
||||
battery_rclick_command = strdup(value);
|
||||
#endif
|
||||
}
|
||||
else if (strcmp(key, "battery_uwheel_command") == 0) {
|
||||
#ifdef ENABLE_BATTERY
|
||||
if (strlen(value) > 0)
|
||||
battery_uwheel_command = strdup(value);
|
||||
#endif
|
||||
}
|
||||
else if (strcmp(key, "battery_dwheel_command") == 0) {
|
||||
#ifdef ENABLE_BATTERY
|
||||
if (strlen(value) > 0)
|
||||
battery_dwheel_command = strdup(value);
|
||||
#endif
|
||||
}
|
||||
else if (strcmp (key, "battery_low_cmd") == 0) {
|
||||
|
||||
Reference in New Issue
Block a user