diff --git a/src/clock/clock.c b/src/clock/clock.c index 9cbccde..f5dab27 100644 --- a/src/clock/clock.c +++ b/src/clock/clock.c @@ -39,7 +39,10 @@ char *time2_timezone; char *time_tooltip_format; char *time_tooltip_timezone; char *clock_lclick_command; +char *clock_mclick_command; char *clock_rclick_command; +char *clock_uwheel_command; +char *clock_dwheel_command; struct timeval time_clock; PangoFontDescription *time1_font_desc; PangoFontDescription *time2_font_desc; @@ -61,7 +64,10 @@ void default_clock() time_tooltip_format = NULL; time_tooltip_timezone = NULL; clock_lclick_command = NULL; + clock_mclick_command = NULL; clock_rclick_command = NULL; + clock_uwheel_command = NULL; + clock_dwheel_command = NULL; time1_font_desc = NULL; time2_font_desc = NULL; } @@ -86,8 +92,14 @@ void cleanup_clock() time_tooltip_timezone = NULL; free(clock_lclick_command); clock_lclick_command = NULL; + free(clock_mclick_command); + clock_mclick_command = NULL; free(clock_rclick_command); clock_rclick_command = NULL; + free(clock_uwheel_command); + clock_uwheel_command = NULL; + free(clock_dwheel_command); + clock_dwheel_command = NULL; stop_timeout(clock_timeout); clock_timeout = NULL; } @@ -277,9 +289,18 @@ void clock_action(int button) case 1: command = clock_lclick_command; break; + case 2: + command = clock_mclick_command; + break; case 3: command = clock_rclick_command; break; + case 4: + command = clock_uwheel_command; + break; + case 5: + command = clock_dwheel_command; + break; } tint_exec(command); } diff --git a/src/clock/clock.h b/src/clock/clock.h index 4c31605..5c72ffb 100644 --- a/src/clock/clock.h +++ b/src/clock/clock.h @@ -33,7 +33,10 @@ extern char *time_tooltip_timezone; extern PangoFontDescription *time1_font_desc; extern PangoFontDescription *time2_font_desc; extern char *clock_lclick_command; +extern char *clock_mclick_command; extern char *clock_rclick_command; +extern char *clock_uwheel_command; +extern char *clock_dwheel_command; extern int clock_enabled; diff --git a/src/config.c b/src/config.c index 51cbb65..1942e04 100644 --- a/src/config.c +++ b/src/config.c @@ -463,10 +463,22 @@ void add_entry (char *key, char *value) if (strlen(value) > 0) clock_lclick_command = strdup(value); } + else if (strcmp(key, "clock_mclick_command") == 0) { + if (strlen(value) > 0) + clock_mclick_command = strdup(value); + } else if (strcmp(key, "clock_rclick_command") == 0) { if (strlen(value) > 0) clock_rclick_command = strdup(value); } + else if (strcmp(key, "clock_uwheel_command") == 0) { + if (strlen(value) > 0) + clock_uwheel_command = strdup(value); + } + else if (strcmp(key, "clock_dwheel_command") == 0) { + if (strlen(value) > 0) + clock_dwheel_command = strdup(value); + } /* Taskbar */ else if (strcmp (key, "taskbar_mode") == 0) { diff --git a/src/tint.c b/src/tint.c index 23a0f8c..c1402fa 100644 --- a/src/tint.c +++ b/src/tint.c @@ -447,7 +447,11 @@ int tint2_handles_click(Panel* panel, XButtonEvent* e) if (tskbar && e->button == 1 && panel_mode == MULTI_DESKTOP) return 1; if (click_clock(panel, e->x, e->y)) { - if ( (e->button == 1 && clock_lclick_command) || (e->button == 3 && clock_rclick_command) ) + if ( (e->button == 1 && clock_lclick_command) || + (e->button == 2 && clock_mclick_command) || + (e->button == 3 && clock_rclick_command) || + (e->button == 4 && clock_uwheel_command) || + (e->button == 5 && clock_dwheel_command) ) return 1; else return 0;