#include <cairo.h>
#include <cairo-xlib.h>
#include <pango/pangocairo.h>
+#include <unistd.h>
#include "window.h"
#include "server.h"
#include "clock.h"
-char *time1_format = 0;
-char *time2_format = 0;
+char *time1_format;
+char *time2_format;
+char *clock_lclick_command;
+char *clock_rclick_command;
struct timeval time_clock;
int time_precision;
PangoFontDescription *time1_font_desc;
XFreePixmap (server.dsp, pmap);
}
+
+void clock_action(int button)
+{
+ char *command = 0;
+ switch (button) {
+ case 1:
+ command = clock_lclick_command;
+ break;
+ case 3:
+ command = clock_rclick_command;
+ break;
+ }
+ if (command) {
+ pid_t pid;
+ pid = fork();
+ if (pid == 0) {
+ execl("/bin/sh", "/bin/sh", "-c", command, NULL);
+ _exit(0);
+ }
+ }
+}
+