2008-10-02 18:47:02 +00:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* Tint2 : clock
|
2009-01-17 14:07:56 +00:00
|
|
|
*
|
2010-11-02 11:40:50 +00:00
|
|
|
* Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr) from Omega distribution
|
2009-01-17 14:07:56 +00:00
|
|
|
*
|
2008-10-02 18:47:02 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License version 2
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <cairo.h>
|
|
|
|
#include <cairo-xlib.h>
|
|
|
|
#include <pango/pangocairo.h>
|
2009-12-30 11:27:29 +00:00
|
|
|
#include <stdlib.h>
|
2008-10-02 18:47:02 +00:00
|
|
|
|
|
|
|
#include "window.h"
|
|
|
|
#include "server.h"
|
2009-10-18 17:54:09 +00:00
|
|
|
#include "panel.h"
|
2008-10-02 18:47:02 +00:00
|
|
|
#include "clock.h"
|
2009-11-15 16:55:50 +00:00
|
|
|
#include "timer.h"
|
2010-06-11 18:47:26 +00:00
|
|
|
#include "common.h"
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2010-04-18 12:07:36 +00:00
|
|
|
char *time1_format;
|
|
|
|
char *time1_timezone;
|
|
|
|
char *time2_format;
|
|
|
|
char *time2_timezone;
|
|
|
|
char *time_tooltip_format;
|
|
|
|
char *time_tooltip_timezone;
|
|
|
|
char *clock_lclick_command;
|
2015-07-13 02:39:14 +00:00
|
|
|
char *clock_mclick_command;
|
2010-04-18 12:07:36 +00:00
|
|
|
char *clock_rclick_command;
|
2015-07-13 02:39:14 +00:00
|
|
|
char *clock_uwheel_command;
|
|
|
|
char *clock_dwheel_command;
|
2009-02-03 20:40:46 +00:00
|
|
|
struct timeval time_clock;
|
2015-12-12 14:13:32 +00:00
|
|
|
gboolean time1_has_font;
|
2010-04-18 12:07:36 +00:00
|
|
|
PangoFontDescription *time1_font_desc;
|
2015-12-12 14:13:32 +00:00
|
|
|
gboolean time2_has_font;
|
2010-04-18 12:07:36 +00:00
|
|
|
PangoFontDescription *time2_font_desc;
|
2010-11-23 15:11:57 +00:00
|
|
|
static char buf_time[256];
|
|
|
|
static char buf_date[256];
|
2015-08-07 05:54:13 +00:00
|
|
|
static char buf_tooltip[512];
|
2009-10-30 17:18:44 +00:00
|
|
|
int clock_enabled;
|
2015-11-20 22:28:37 +00:00
|
|
|
static timeout *clock_timeout;
|
2010-04-18 12:07:36 +00:00
|
|
|
|
2015-12-12 14:13:32 +00:00
|
|
|
void clock_init_fonts();
|
|
|
|
|
2010-04-18 12:07:36 +00:00
|
|
|
void default_clock()
|
|
|
|
{
|
|
|
|
clock_enabled = 0;
|
2015-04-11 09:51:10 +00:00
|
|
|
clock_timeout = NULL;
|
|
|
|
time1_format = NULL;
|
|
|
|
time1_timezone = NULL;
|
|
|
|
time2_format = NULL;
|
|
|
|
time2_timezone = NULL;
|
|
|
|
time_tooltip_format = NULL;
|
|
|
|
time_tooltip_timezone = NULL;
|
|
|
|
clock_lclick_command = NULL;
|
2015-07-13 02:39:14 +00:00
|
|
|
clock_mclick_command = NULL;
|
2015-04-11 09:51:10 +00:00
|
|
|
clock_rclick_command = NULL;
|
2015-07-13 02:39:14 +00:00
|
|
|
clock_uwheel_command = NULL;
|
|
|
|
clock_dwheel_command = NULL;
|
2015-12-12 14:13:32 +00:00
|
|
|
time1_has_font = FALSE;
|
2015-04-11 09:51:10 +00:00
|
|
|
time1_font_desc = NULL;
|
2015-12-12 14:13:32 +00:00
|
|
|
time2_has_font = FALSE;
|
2015-04-11 09:51:10 +00:00
|
|
|
time2_font_desc = NULL;
|
2010-04-18 12:07:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void cleanup_clock()
|
|
|
|
{
|
2015-04-11 09:51:10 +00:00
|
|
|
pango_font_description_free(time1_font_desc);
|
|
|
|
time1_font_desc = NULL;
|
|
|
|
pango_font_description_free(time2_font_desc);
|
|
|
|
time2_font_desc = NULL;
|
|
|
|
free(time1_format);
|
|
|
|
time1_format = NULL;
|
|
|
|
free(time2_format);
|
|
|
|
time2_format = NULL;
|
|
|
|
free(time_tooltip_format);
|
|
|
|
time_tooltip_format = NULL;
|
|
|
|
free(time1_timezone);
|
|
|
|
time1_timezone = NULL;
|
|
|
|
free(time2_timezone);
|
|
|
|
time2_timezone = NULL;
|
|
|
|
free(time_tooltip_timezone);
|
|
|
|
time_tooltip_timezone = NULL;
|
|
|
|
free(clock_lclick_command);
|
|
|
|
clock_lclick_command = NULL;
|
2015-07-13 02:39:14 +00:00
|
|
|
free(clock_mclick_command);
|
|
|
|
clock_mclick_command = NULL;
|
2015-04-11 09:51:10 +00:00
|
|
|
free(clock_rclick_command);
|
|
|
|
clock_rclick_command = NULL;
|
2015-07-13 02:39:14 +00:00
|
|
|
free(clock_uwheel_command);
|
|
|
|
clock_uwheel_command = NULL;
|
|
|
|
free(clock_dwheel_command);
|
|
|
|
clock_dwheel_command = NULL;
|
2015-04-11 09:51:10 +00:00
|
|
|
stop_timeout(clock_timeout);
|
|
|
|
clock_timeout = NULL;
|
2010-04-18 12:07:36 +00:00
|
|
|
}
|
2009-02-03 20:40:46 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
void update_clocks_sec(void *arg)
|
2009-06-05 18:53:49 +00:00
|
|
|
{
|
2009-11-15 16:55:50 +00:00
|
|
|
gettimeofday(&time_clock, 0);
|
|
|
|
int i;
|
|
|
|
if (time1_format) {
|
2015-11-20 22:28:37 +00:00
|
|
|
for (i = 0; i < num_panels; i++)
|
|
|
|
panels[i].clock.area.resize_needed = 1;
|
2009-11-15 16:55:50 +00:00
|
|
|
}
|
2015-11-20 22:28:37 +00:00
|
|
|
panel_refresh = TRUE;
|
2009-06-05 18:53:49 +00:00
|
|
|
}
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
void update_clocks_min(void *arg)
|
2010-02-03 12:05:16 +00:00
|
|
|
{
|
2010-02-08 22:44:56 +00:00
|
|
|
// remember old_sec because after suspend/hibernate the clock should be updated directly, and not
|
|
|
|
// on next minute change
|
|
|
|
time_t old_sec = time_clock.tv_sec;
|
2010-02-03 12:05:16 +00:00
|
|
|
gettimeofday(&time_clock, 0);
|
2010-02-08 22:44:56 +00:00
|
|
|
if (time_clock.tv_sec % 60 == 0 || time_clock.tv_sec - old_sec > 60) {
|
2010-02-03 12:05:16 +00:00
|
|
|
int i;
|
|
|
|
if (time1_format) {
|
2015-11-20 22:28:37 +00:00
|
|
|
for (i = 0; i < num_panels; i++)
|
|
|
|
panels[i].clock.area.resize_needed = 1;
|
2010-02-03 12:05:16 +00:00
|
|
|
}
|
2015-11-20 22:28:37 +00:00
|
|
|
panel_refresh = TRUE;
|
2010-02-03 12:05:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
struct tm *clock_gettime_for_tz(const char *timezone)
|
|
|
|
{
|
2009-12-30 11:27:29 +00:00
|
|
|
if (timezone) {
|
2015-11-20 22:28:37 +00:00
|
|
|
const char *old_tz = getenv("TZ");
|
2009-12-30 11:27:29 +00:00
|
|
|
setenv("TZ", timezone, 1);
|
2015-11-20 22:28:37 +00:00
|
|
|
struct tm *result = localtime(&time_clock.tv_sec);
|
|
|
|
if (old_tz)
|
|
|
|
setenv("TZ", old_tz, 1);
|
|
|
|
else
|
|
|
|
unsetenv("TZ");
|
2009-12-30 11:27:29 +00:00
|
|
|
return result;
|
2015-11-20 22:28:37 +00:00
|
|
|
} else
|
|
|
|
return localtime(&time_clock.tv_sec);
|
2009-12-30 11:27:29 +00:00
|
|
|
}
|
2009-06-05 18:53:49 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
char *clock_get_tooltip(void *obj)
|
2009-11-16 17:17:53 +00:00
|
|
|
{
|
2015-08-07 05:54:13 +00:00
|
|
|
strftime(buf_tooltip, sizeof(buf_tooltip), time_tooltip_format, clock_gettime_for_tz(time_tooltip_timezone));
|
|
|
|
return strdup(buf_tooltip);
|
2009-11-16 17:17:53 +00:00
|
|
|
}
|
|
|
|
|
2015-02-04 22:09:20 +00:00
|
|
|
int time_format_needs_sec_ticks(char *time_format)
|
|
|
|
{
|
|
|
|
if (!time_format)
|
|
|
|
return 0;
|
|
|
|
if (strchr(time_format, 'S') || strchr(time_format, 'T') || strchr(time_format, 'r'))
|
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
2009-11-16 17:17:53 +00:00
|
|
|
|
2009-02-15 17:22:48 +00:00
|
|
|
void init_clock()
|
2008-10-02 18:47:02 +00:00
|
|
|
{
|
2015-04-11 09:51:10 +00:00
|
|
|
if (!clock_timeout) {
|
2015-11-20 22:28:37 +00:00
|
|
|
if (time_format_needs_sec_ticks(time1_format) || time_format_needs_sec_ticks(time2_format)) {
|
2015-04-17 20:17:25 +00:00
|
|
|
clock_timeout = add_timeout(10, 1000, update_clocks_sec, 0, &clock_timeout);
|
2015-02-04 22:09:20 +00:00
|
|
|
} else {
|
2015-04-17 20:17:25 +00:00
|
|
|
clock_timeout = add_timeout(10, 1000, update_clocks_min, 0, &clock_timeout);
|
2015-02-04 22:09:20 +00:00
|
|
|
}
|
2009-11-15 16:55:50 +00:00
|
|
|
}
|
2009-10-18 17:54:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void init_clock_panel(void *p)
|
|
|
|
{
|
2015-11-20 22:28:37 +00:00
|
|
|
Panel *panel = (Panel *)p;
|
2009-10-18 17:54:09 +00:00
|
|
|
Clock *clock = &panel->clock;
|
2015-11-20 22:28:37 +00:00
|
|
|
|
2015-04-11 09:51:10 +00:00
|
|
|
if (!clock->area.bg)
|
2011-02-20 22:32:35 +00:00
|
|
|
clock->area.bg = &g_array_index(backgrounds, Background, 0);
|
2015-12-12 14:13:32 +00:00
|
|
|
clock_init_fonts();
|
2009-10-18 17:54:09 +00:00
|
|
|
clock->area.parent = p;
|
|
|
|
clock->area.panel = p;
|
2015-11-20 22:28:37 +00:00
|
|
|
clock->area.has_mouse_press_effect = clock->area.has_mouse_over_effect =
|
|
|
|
clock_lclick_command || clock_mclick_command || clock_rclick_command || clock_uwheel_command ||
|
|
|
|
clock_dwheel_command;
|
2009-10-18 17:54:09 +00:00
|
|
|
clock->area._draw_foreground = draw_clock;
|
2015-11-20 22:28:37 +00:00
|
|
|
clock->area.size_mode = LAYOUT_FIXED;
|
|
|
|
clock->area._resize = resize_clock;
|
2010-09-18 14:58:00 +00:00
|
|
|
// check consistency
|
2015-04-11 09:51:10 +00:00
|
|
|
if (!time1_format)
|
2010-09-18 14:58:00 +00:00
|
|
|
return;
|
2009-10-18 17:54:09 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
clock->area.resize_needed = 1;
|
|
|
|
clock->area.on_screen = TRUE;
|
2009-11-16 17:17:53 +00:00
|
|
|
|
|
|
|
if (time_tooltip_format) {
|
|
|
|
clock->area._get_tooltip_text = clock_get_tooltip;
|
2015-08-07 05:54:13 +00:00
|
|
|
strftime(buf_tooltip, sizeof(buf_tooltip), time_tooltip_format, clock_gettime_for_tz(time_tooltip_timezone));
|
2009-11-16 17:17:53 +00:00
|
|
|
}
|
2008-10-02 18:47:02 +00:00
|
|
|
}
|
|
|
|
|
2015-12-12 14:13:32 +00:00
|
|
|
void clock_init_fonts()
|
|
|
|
{
|
|
|
|
if (!time1_font_desc) {
|
|
|
|
time1_font_desc = pango_font_description_from_string(get_default_font());
|
|
|
|
pango_font_description_set_weight(time1_font_desc, PANGO_WEIGHT_BOLD);
|
|
|
|
pango_font_description_set_size(time1_font_desc,
|
2015-12-13 09:48:06 +00:00
|
|
|
pango_font_description_get_size(time1_font_desc));
|
2015-12-12 14:13:32 +00:00
|
|
|
}
|
|
|
|
if (!time2_font_desc) {
|
|
|
|
time2_font_desc = pango_font_description_from_string(get_default_font());
|
|
|
|
pango_font_description_set_size(time2_font_desc,
|
|
|
|
pango_font_description_get_size(time2_font_desc) - PANGO_SCALE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void clock_default_font_changed()
|
|
|
|
{
|
|
|
|
if (!clock_enabled)
|
|
|
|
return;
|
|
|
|
if (time1_has_font && time2_has_font)
|
|
|
|
return;
|
|
|
|
if (!time1_has_font) {
|
|
|
|
pango_font_description_free(time1_font_desc);
|
|
|
|
time1_font_desc = NULL;
|
|
|
|
}
|
|
|
|
if (!time2_has_font) {
|
|
|
|
pango_font_description_free(time2_font_desc);
|
|
|
|
time2_font_desc = NULL;
|
|
|
|
}
|
|
|
|
clock_init_fonts();
|
|
|
|
for (int i = 0; i < num_panels; i++) {
|
|
|
|
panels[i].clock.area.resize_needed = TRUE;
|
|
|
|
panels[i].clock.area.redraw_needed = TRUE;
|
|
|
|
}
|
|
|
|
panel_refresh = TRUE;
|
|
|
|
}
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
void draw_clock(void *obj, cairo_t *c)
|
2009-02-10 23:16:10 +00:00
|
|
|
{
|
2009-09-07 21:41:21 +00:00
|
|
|
Clock *clock = obj;
|
|
|
|
PangoLayout *layout;
|
2009-02-10 23:16:10 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
layout = pango_cairo_create_layout(c);
|
2009-02-10 23:16:10 +00:00
|
|
|
|
2009-09-07 21:41:21 +00:00
|
|
|
// draw layout
|
2015-11-20 22:28:37 +00:00
|
|
|
pango_layout_set_font_description(layout, time1_font_desc);
|
|
|
|
pango_layout_set_width(layout, clock->area.width * PANGO_SCALE);
|
|
|
|
pango_layout_set_alignment(layout, PANGO_ALIGN_CENTER);
|
2015-10-18 14:51:08 +00:00
|
|
|
pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR);
|
|
|
|
pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_NONE);
|
2015-11-20 22:28:37 +00:00
|
|
|
pango_layout_set_text(layout, buf_time, strlen(buf_time));
|
2009-02-10 23:16:10 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
cairo_set_source_rgba(c, clock->font.rgb[0], clock->font.rgb[1], clock->font.rgb[2], clock->font.alpha);
|
2009-02-10 23:16:10 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
pango_cairo_update_layout(c, layout);
|
|
|
|
draw_text(layout, c, 0, clock->time1_posy, &clock->font, ((Panel *)clock->area.panel)->font_shadow);
|
2009-02-10 23:16:10 +00:00
|
|
|
|
2009-09-07 21:41:21 +00:00
|
|
|
if (time2_format) {
|
2015-11-20 22:28:37 +00:00
|
|
|
pango_layout_set_font_description(layout, time2_font_desc);
|
2009-09-07 21:41:21 +00:00
|
|
|
pango_layout_set_indent(layout, 0);
|
2015-11-20 22:28:37 +00:00
|
|
|
pango_layout_set_text(layout, buf_date, strlen(buf_date));
|
|
|
|
pango_layout_set_width(layout, clock->area.width * PANGO_SCALE);
|
2009-02-10 23:16:10 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
pango_cairo_update_layout(c, layout);
|
|
|
|
draw_text(layout, c, 0, clock->time2_posy, &clock->font, ((Panel *)clock->area.panel)->font_shadow);
|
2009-09-07 21:41:21 +00:00
|
|
|
}
|
2009-02-10 23:16:10 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
g_object_unref(layout);
|
2009-02-10 23:16:10 +00:00
|
|
|
}
|
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
gboolean resize_clock(void *obj)
|
2008-10-02 18:47:02 +00:00
|
|
|
{
|
2009-09-07 21:41:21 +00:00
|
|
|
Clock *clock = obj;
|
2010-09-21 09:54:19 +00:00
|
|
|
Panel *panel = clock->area.panel;
|
|
|
|
int time_height_ink, time_height, time_width, date_height_ink, date_height, date_width, ret = 0;
|
2008-10-02 18:47:02 +00:00
|
|
|
|
2015-11-20 22:28:37 +00:00
|
|
|
clock->area.redraw_needed = TRUE;
|
|
|
|
|
2010-09-22 19:33:10 +00:00
|
|
|
date_height = date_width = 0;
|
2009-12-30 11:27:29 +00:00
|
|
|
strftime(buf_time, sizeof(buf_time), time1_format, clock_gettime_for_tz(time1_timezone));
|
2015-11-20 22:28:37 +00:00
|
|
|
get_text_size2(time1_font_desc,
|
|
|
|
&time_height_ink,
|
|
|
|
&time_height,
|
|
|
|
&time_width,
|
|
|
|
panel->area.height,
|
|
|
|
panel->area.width,
|
|
|
|
buf_time,
|
|
|
|
strlen(buf_time),
|
2015-10-18 14:51:08 +00:00
|
|
|
PANGO_WRAP_WORD_CHAR,
|
2015-12-05 10:42:07 +00:00
|
|
|
PANGO_ELLIPSIZE_NONE,
|
|
|
|
FALSE);
|
2010-09-21 09:54:19 +00:00
|
|
|
if (time2_format) {
|
2009-12-30 11:27:29 +00:00
|
|
|
strftime(buf_date, sizeof(buf_date), time2_format, clock_gettime_for_tz(time2_timezone));
|
2015-11-20 22:28:37 +00:00
|
|
|
get_text_size2(time2_font_desc,
|
|
|
|
&date_height_ink,
|
|
|
|
&date_height,
|
|
|
|
&date_width,
|
|
|
|
panel->area.height,
|
|
|
|
panel->area.width,
|
|
|
|
buf_date,
|
|
|
|
strlen(buf_date),
|
2015-10-18 14:51:08 +00:00
|
|
|
PANGO_WRAP_WORD_CHAR,
|
2015-12-05 10:42:07 +00:00
|
|
|
PANGO_ELLIPSIZE_NONE,
|
|
|
|
FALSE);
|
2010-09-21 09:54:19 +00:00
|
|
|
}
|
2010-09-22 22:01:37 +00:00
|
|
|
|
2010-09-21 09:54:19 +00:00
|
|
|
if (panel_horizontal) {
|
|
|
|
int new_size = (time_width > date_width) ? time_width : date_width;
|
2015-11-20 22:28:37 +00:00
|
|
|
new_size += (2 * clock->area.paddingxlr) + (2 * clock->area.bg->border.width);
|
|
|
|
if (new_size > clock->area.width || new_size < (clock->area.width - 6)) {
|
|
|
|
// we try to limit the number of resizes
|
2010-09-21 09:54:19 +00:00
|
|
|
clock->area.width = new_size + 1;
|
|
|
|
clock->time1_posy = (clock->area.height - time_height) / 2;
|
|
|
|
if (time2_format) {
|
2015-11-20 22:28:37 +00:00
|
|
|
clock->time1_posy -= (date_height) / 2;
|
2011-01-08 13:56:26 +00:00
|
|
|
clock->time2_posy = clock->time1_posy + time_height;
|
2010-09-21 09:54:19 +00:00
|
|
|
}
|
|
|
|
ret = 1;
|
|
|
|
}
|
2015-11-20 22:28:37 +00:00
|
|
|
} else {
|
2010-09-21 09:54:19 +00:00
|
|
|
int new_size = time_height + date_height + (2 * (clock->area.paddingxlr + clock->area.bg->border.width));
|
|
|
|
if (new_size != clock->area.height) {
|
2015-11-20 22:28:37 +00:00
|
|
|
// we try to limit the number of resizes
|
|
|
|
clock->area.height = new_size;
|
2010-09-21 09:54:19 +00:00
|
|
|
clock->time1_posy = (clock->area.height - time_height) / 2;
|
|
|
|
if (time2_format) {
|
2015-11-20 22:28:37 +00:00
|
|
|
clock->time1_posy -= (date_height) / 2;
|
2011-01-08 13:56:26 +00:00
|
|
|
clock->time2_posy = clock->time1_posy + time_height;
|
2010-09-21 09:54:19 +00:00
|
|
|
}
|
|
|
|
ret = 1;
|
|
|
|
}
|
2009-09-07 21:41:21 +00:00
|
|
|
}
|
2009-01-17 14:07:56 +00:00
|
|
|
|
2010-09-16 23:24:25 +00:00
|
|
|
return ret;
|
2008-10-02 18:47:02 +00:00
|
|
|
}
|
|
|
|
|
2009-06-04 18:41:14 +00:00
|
|
|
void clock_action(int button)
|
|
|
|
{
|
|
|
|
char *command = 0;
|
|
|
|
switch (button) {
|
2015-11-20 22:28:37 +00:00
|
|
|
case 1:
|
2009-06-04 18:41:14 +00:00
|
|
|
command = clock_lclick_command;
|
|
|
|
break;
|
2015-11-20 22:28:37 +00:00
|
|
|
case 2:
|
2015-07-13 02:39:14 +00:00
|
|
|
command = clock_mclick_command;
|
|
|
|
break;
|
2015-11-20 22:28:37 +00:00
|
|
|
case 3:
|
2009-06-04 18:41:14 +00:00
|
|
|
command = clock_rclick_command;
|
|
|
|
break;
|
2015-11-20 22:28:37 +00:00
|
|
|
case 4:
|
2015-07-13 02:39:14 +00:00
|
|
|
command = clock_uwheel_command;
|
|
|
|
break;
|
2015-11-20 22:28:37 +00:00
|
|
|
case 5:
|
2015-07-13 02:39:14 +00:00
|
|
|
command = clock_dwheel_command;
|
|
|
|
break;
|
2009-06-04 18:41:14 +00:00
|
|
|
}
|
2010-08-02 18:07:31 +00:00
|
|
|
tint_exec(command);
|
2009-06-04 18:41:14 +00:00
|
|
|
}
|
2015-12-12 14:13:32 +00:00
|
|
|
|