Code: Select all
void DrawErrMsgOnMenu( char *str1, char *str2 )
{
//char *str;
static int call=0;
//int wait_s;
call++;
/*str = calloc( strlen(str1)+strlen(str2)+1, 1 );
sprintf( str, "%s%s", str1, str2 );*/
printf("hazewm error: %s%s\n", str1, str2);
if( call<5 ) XBell( dpy, 30 );
/*DrawStringMenuBar( str );
wait_s = 3000000-call/5*500000;
wait_s = wait_s>0? wait_s : 300000;
sleep_a_little( wait_s );
free( str );*/
}
ofclock wont swallow with jwm. Added that and some mouseclick action/control with below patch:
Code: Select all
--- ./ofclock.c.01 1999-01-23 11:49:14.000000000 +0000
+++ ./ofclock.c 2013-10-06 10:37:40.000000000 +0000
@@ -1,5 +1,6 @@
/* digital clock for X by Li Wei Jih & Olivier Fourdan */
+#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
@@ -51,6 +52,7 @@
#include "digits/fr.xbm"
#include "digits/sa.xbm"
+char leftcommand[7] = "xcal &";
char copyright[]= "digital clock for X by Li Wei Jih & Olivier Fourdan";
char appname[255]= "clock";
Pixmap dclock_pixmap, dclock_nosec_pixmap, digit_pixmap[11],
@@ -442,6 +444,17 @@
0, foreground, background);
defdecor (*display, *window, (MWM_DECOR_MINIMIZE | MWM_DECOR_TITLE /* | MWM_DECOR_BORDER */));
+
+ // Set classhint
+ XClassHint classHint;
+ classHint.res_name = appname;
+ classHint.res_class = appname;
+ XSetClassHint(*display, *window, &classHint);
+
+ // Set windowname
+ XStoreName(*display, *window, appname);
+ XSetIconName(*display, *window, appname);
+
loadpixmap(*display, *window); /* load pixmaps */
*gc= XCreateGC(*display, *window, 0, 0);
@@ -487,13 +500,23 @@
showtime(display, window, gc, timearray);
break;
case ButtonPress:
- XRaiseWindow(display, window);
- org_x= event.xbutton.x; /* gets mouse position */
- org_y= event.xbutton.y; /* before moves clock */
- break;
- case MotionNotify: /* moves clock */
- XMoveWindow(display, window,
- event.xmotion.x_root- org_x, event.xmotion.y_root- org_y);
+ if(event.xbutton.button == 1) {
+ //printf("left button pressed\n");
+ system(leftcommand);
+ }
+ if(event.xbutton.button == 2) {
+ //printf("middle button pressed\n");
+ no_second= !no_second;
+ changesize(display, window);
+ showtime(display, window, gc, timearray);
+ }
+ if(event.xbutton.button == 3) {
+ //printf("right button pressed\n");
+ hr12= !hr12;
+ getdigitstr(timearray);
+ showtime(display, window, gc, timearray);
+ }
+
break;
case VisibilityNotify:
switch (event.xvisibility.state)