Page 1 of 4

Posted: Thu 03 Oct 2013, 18:40
by Keef
wot Techno said...

Missing xpms lead to a very long startup. For icons, what about the JQ8flat icon theme? What I do like, is that if there is available desktop space, it will tile newly opened windows. If not, they just get stacked, but over the open space. Agree with the point about not being able to minimise, although you can hide/unhide.

@goingnuts
Tried your menu script, which worked fine on 214R, but most items end up in 'Other', and the long list reaches the bottom of the screen but no scrolling - got cut off at the P's, which sounds painful, I know.

Posted: Thu 03 Oct 2013, 21:01
by Keef
Not quite what I was hoping for, but could be worse:

Posted: Fri 04 Oct 2013, 02:28
by technosaurus
Keef wrote:Missing xpms lead to a very long startup. For icons, what about the JQ8flat icon theme? What I do like, is that if there is available desktop space, it will tile newly opened windows. If not, they just get stacked, but over the open space. Agree with the point about not being able to minimise, although you can hide/unhide.
could just modify the sleep_a_little code (first time I recall noticing select() being used)

Posted: Fri 04 Oct 2013, 15:44
by goingnuts
Keef wrote:@goingnuts
Tried your menu script, which worked fine on 214R, but most items end up in 'Other', and the long list reaches the bottom of the screen but no scrolling - got cut off at the P's, which sounds painful, I know.
I know...try P412 and pain comes at "d..." or something like that. But it was just a quick trial - might have modify categories.
Could be that early jwm would be a better starting point but as far as I know jwm wont support multiple main menus - which is part of the fun with hazewm.

Posted: Fri 04 Oct 2013, 20:15
by Keef
Following Techno's suggestion, I reduced the error wait. Took a 0 out of line 136 & 137 (wait_s) in misc.c. Just a quick flash now...

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 );
	if( call<5 )	XBell( dpy, 30 );
	DrawStringMenuBar( str );
	wait_s = 300000-call/5*50000; 
	wait_s = wait_s>0? wait_s : 300000;
	sleep_a_little( wait_s );
	free( str );
}

Posted: Sat 05 Oct 2013, 18:14
by goingnuts
I tried to change to a simple printf function in the hope that errors would end up in xerrors.log - but they do not - why?

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 );*/
}
Found a decent clock - ofclock - integrates nicely with hazewm. Although xclock have more settings I really just want to know the time...
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)

Posted: Sat 05 Oct 2013, 21:53
by Keef
This is a bad case of 'coding-by-Google' but this succeeds in writing to a file:

Code: Select all

void DrawErrMsgOnMenu( char *str1, char *str2 )
{
   FILE *file;
   file = fopen("haze_err.txt","a");
   char *str;
   static int call=0;
   int wait_s;

   call++;
   str = calloc( strlen(str1)+strlen(str2)+1, 1 );
 //  sprintf( str, "%s%s", str1, str2 );
   fprintf(file, "hazewm error: %s%s\n", str1, str2 );
   fclose(file);
 //  if( call<5 )   XBell( dpy, 30 );
/*   DrawStringMenuBar( str );
   wait_s = 1000000-call/5*500000;
   wait_s = wait_s>0? wait_s : 100000;
   sleep_a_little( wait_s );*/ 
   free( str );
  
}
Had no luck at all with printf (always a blank file), but eventually found a reference to fprintf and that works.
The file ends up in root/

EDIT:

Code: Select all

file = fopen("/tmp/xerrs.log","a+");
will work, I just hadn't tried it yet...

Posted: Sun 06 Oct 2013, 05:56
by technosaurus
A little known tidbit about printf - it prints to stdout which is buffered (stderr is not IIRC), so if you didn't add a '\n', it would just keep buffering until it got one. This is useful for instance if you need to use '\b' to overwrite something, but mostly to reduce unnecessary i/o.

Posted: Sun 06 Oct 2013, 06:16
by goingnuts
Keef: Thanks - good hints. Now it can be reduced to

Code: Select all

void DrawErrMsgOnMenu( char *str1, char *str2 )
{fprintf(stderr, "hazewm error: %s%s\n", str1, str2);}
and errors ends up in xerrs.log. Removed the Xbell as well - I do not hear the bells - do you?
20131010: Attached 4 patches - one fix missing fonts, one sends errors to stdout (and not to menubar) - one remove some warnings and the last adds icewm systemsounds.
For the system sounds to work compile with " -DCONFIG_GUIEVENTS" and you also needs a configured "icesound" or my replacement "newsound"...

Posted: Thu 10 Oct 2013, 16:17
by goingnuts
A "collage" of hazewm-0.2 with above patches and configured with systemsounds can be downloaded here. Also a small collection of applications included (animate, montage, xdesktopwaves, calctool, identify, newsound, tcmixer, xli, combine, import, ofclock, wavplay, xmountains, convert, mcb_imagemagick, pmfree, wavrec, xsetroot, defaultaudioplayer, minimp3, pupslock,xautolock, xtp, display, mogrify, setterm, xcal, xvidcap).
Used some of technosaurus tango32xpm icons, revised the pm_haze_xdg.sh script to use desktopfiles found in /usr/share/haze/applications.

Its for fun - and a nice sandbox for test of applications that NEED root window visible (if you as user need to view what it does...)

Posted: Thu 10 Oct 2013, 19:18
by technosaurus
@goingnuts, I'm guessing you built static against tinyx11, since I don't see it in top (it uses less resource than the shared build of bash)

Posted: Thu 10 Oct 2013, 19:56
by Keef
Good work as ever, goingnuts. I bet samira was wondering if a pet would ever appear.

On my starthaze, I added

Code: Select all

echo "xsetroot -cursor_name top_left_arrow" > $HOME/.xinitrc
to get rid of the cross-hair cursor. Just nicked it from the standard xinitrc.

Posted: Fri 11 Oct 2013, 03:56
by goingnuts
technosaurus wrote:@goingnuts, I'm guessing you built static against tinyx11, since I don't see it in top (it uses less resource than the shared build of bash)
That is right - top reports 376 for the static linked hazewm. Source holds a lot of code dedicated to style system8 which is never used - wonder if resource usage would be minimized if cleaned out. It would be nice to have keyboard-control of the menus as well + full screen support but I haven't been able to get that working.
Keef: Good point - I changed that to

Code: Select all

echo "xsetroot -cursor_name left_ptr" > $HOME/.xinitrc
to give me same cursor on root window as over menus.

Posted: Fri 11 Oct 2013, 13:57
by technosaurus
goingnuts wrote:Source holds a lot of code dedicated to style system8 which is never used - wonder if resource usage would be minimized if cleaned out. It would be nice to have keyboard-control of the menus as well + full screen support but I haven't been able to get that working.
I don't even know what "style system8" is, I would just comment it out rather than remove it outright. Keyboard control in wm can be difficult to do right, IIRC tinywm is the most concise example I've seen (it does alt+click to drag).

I know the number of menu items is limited by size, but since haze can handle submenus, it may be useful to adapt my jwm_menu_create with the submenus part required, possibly using some tango icon defaults for submenus.

Posted: Fri 11 Oct 2013, 19:48
by goingnuts
system8 is a style left over from mvlwm but not functional in hazewm anymore (behavior, decoration etc.) - might try to comment them out as you suggest - just to see influence on bin-size and resource usage.

Found a graphic view of a lot of wm and the relations here: http://www.gilesorr.com/wm/bloodlines.svg

Are there any general/common/standard rules for the categories/subcategories in the menus?

If anyone running the "hazewm-collage" leaves the desktop without activity for more than 10 minutes the xautolock triggers pupslock and screen is locked. To release it just type user/admin password.

Posted: Fri 11 Oct 2013, 20:25
by technosaurus

Tinkering w/ Haze WM

Posted: Sun 13 Oct 2013, 16:43
by samira
Hey everyone,
I managed to get a .tar.gz file with the haze binaries.. Tried it out, was ok at first. Then i noticed the fonts look funny in italics. Any way to change the fonts? Because in the hazerc the font options are rather cryptic.
And by the way, anyone notice the close button on the left is slightly to the right?

Tinkering w/ Haze WM

Posted: Sun 13 Oct 2013, 16:46
by samira
P/S: any idea where the color of the menu bar is specified in the sources? I'd like to change it to grey (dark or light), white or silverish..

Posted: Sun 13 Oct 2013, 18:01
by Keef
To find a usable font on your system, use xfsontsel. 'select' copies the line to the clipboard, so you can paste it to hazerc.
I'd like to change the menu background too, but no joy yet.

Posted: Mon 14 Oct 2013, 16:33
by goingnuts
Close button intended right can be left aligned by deleting "sticky"-flag from menu.
Menubar color and height are hard coded. Attached patch add option

Code: Select all

DECORATIONS_INACTIVE_BG	gray

MENUBARHEIGHT  32

## Number of Desktop
to set the menu bar height to whatever size you want. Thats handy as one can reuse the 32-icons as miniicons:

Code: Select all

# Old mlvwm style definitons
Style
"calctool" MiniIcon accessories-calculator.xpm NoResizeR
which will replace the red X with the icon in menubar upper right.
Or you could set height to 48 and swallow some cool WindowMaker-style dockapps...

I have worked on the pm_haze_xdg.sh script to handle more categories but not quite set yet. Going towards a Gnome-panel-like solution where most menus are in sub menus of an "Application"-main-menu...

I try to keep the "hazewm-0.2-collage" updated for download here