Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 02 Aug 2014, 02:42
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Tinkering w/ Haze WM
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 6 [77 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
Author Message
Keef


Joined: 20 Dec 2007
Posts: 619
Location: Staffordshire

PostPosted: Thu 03 Oct 2013, 14:40    Post subject:  

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.
Back to top
View user's profile Send private message 
Keef


Joined: 20 Dec 2007
Posts: 619
Location: Staffordshire

PostPosted: Thu 03 Oct 2013, 17:01    Post subject:  

Not quite what I was hoping for, but could be worse:
hazewm.png
 Description   JQ8flat icon
 Filesize   9.4 KB
 Viewed   486 Time(s)

hazewm.png

Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4293

PostPosted: Thu 03 Oct 2013, 22:28    Post subject:  

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)
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Fri 04 Oct 2013, 11:44    Post subject:  

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.
Back to top
View user's profile Send private message Visit poster's website 
Keef


Joined: 20 Dec 2007
Posts: 619
Location: Staffordshire

PostPosted: Fri 04 Oct 2013, 16:15    Post subject:  

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:
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 );
}
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Sat 05 Oct 2013, 14:14    Post subject:  

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:
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:
--- ./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)

Last edited by goingnuts on Sun 06 Oct 2013, 04:32; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
Keef


Joined: 20 Dec 2007
Posts: 619
Location: Staffordshire

PostPosted: Sat 05 Oct 2013, 17:53    Post subject:  

This is a bad case of 'coding-by-Google' but this succeeds in writing to a file:
Code:
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:
file = fopen("/tmp/xerrs.log","a+");
will work, I just hadn't tried it yet...
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4293

PostPosted: Sun 06 Oct 2013, 01:56    Post subject:  

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.
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Sun 06 Oct 2013, 02:16    Post subject:  

Keef: Thanks - good hints. Now it can be reduced to
Code:
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"...
haze-0.2_warnings.diff.gz
Description 
gz

 Download 
Filename  haze-0.2_warnings.diff.gz 
Filesize  2.02 KB 
Downloaded  174 Time(s) 
haze-0.2_errors_to_stderr.diff.gz
Description 
gz

 Download 
Filename  haze-0.2_errors_to_stderr.diff.gz 
Filesize  618 Bytes 
Downloaded  182 Time(s) 
haze-0.2_font.diff.gz
Description 
gz

 Download 
Filename  haze-0.2_font.diff.gz 
Filesize  505 Bytes 
Downloaded  183 Time(s) 
haze-0.2_icewm_systemsounds.diff.gz
Description 
gz

 Download 
Filename  haze-0.2_icewm_systemsounds.diff.gz 
Filesize  4.78 KB 
Downloaded  180 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Thu 10 Oct 2013, 12:17    Post subject:  

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...)
haze_collage.png
 Description   
 Filesize   189.55 KB
 Viewed   284 Time(s)

haze_collage.png

Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4293

PostPosted: Thu 10 Oct 2013, 15:18    Post subject:  

@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)
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Keef


Joined: 20 Dec 2007
Posts: 619
Location: Staffordshire

PostPosted: Thu 10 Oct 2013, 15:56    Post subject:  

Good work as ever, goingnuts. I bet samira was wondering if a pet would ever appear.

On my starthaze, I added
Code:
echo "xsetroot -cursor_name top_left_arrow" > $HOME/.xinitrc
to get rid of the cross-hair cursor. Just nicked it from the standard xinitrc.
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Thu 10 Oct 2013, 23:56    Post subject:  

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:
echo "xsetroot -cursor_name left_ptr" > $HOME/.xinitrc
to give me same cursor on root window as over menus.
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4293

PostPosted: Fri 11 Oct 2013, 09:57    Post subject:  

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.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Fri 11 Oct 2013, 15:48    Post subject:  

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.
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 2 of 6 [77 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1017s ][ Queries: 13 (0.0056s) ][ GZIP on ]