You are not logged in.

#176 2011-08-20 12:21:10

el mariachi
Member
Registered: 2007-11-30
Posts: 595

Re: catwm, Cute and Tiny Window Manager

Cool wm big_smile it won't replace my patched dwm (I miss a top bar tongue, but if there was a way to hide dzen and show it with keypressesthat would work for me big_smile), but it's simplicity is very appealing !
keep up the good work big_smile

I don't see that much of a resource uasge difference... maybe that's because dwm is so light already :s

Last edited by el mariachi (2011-08-20 12:26:50)

Offline

#177 2011-08-20 19:47:58

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: catwm, Cute and Tiny Window Manager

Thanks for adding it to github, and really cool that you've begun xcb porting, that rocks!

Imho, you should change the name away from catwm, like you've allready talked about, as I believe you're not allowed to use a copyighted name without consent from the author...

@el mariachi, i've not tryed this new revision yet, but the last rev i tried used a little under half the ram of dwm and much smaller filesize, but to get accurate memory usage, then please use ps_mem.py to test with...

Offline

#178 2011-08-20 21:13:42

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: catwm, Cute and Tiny Window Manager

moetunes wrote:

'snip'

It's great to see that you've picked up on the wm. However, I do believe that you need to retain mention of catwm in your license, as it is a fork and still contains a lot of code from the original project. smile

Cheers for that smile
I'd appreciate an idea of the sort of references required as the whole framework is pyknites' but I can't say that he is still interested in it so I don't want to include his email address e.g. Or should I just still call it catwm ?

Here's the relevant part of the gpl:

,----
| 2. You may modify your copy or copies of the Program or any portion
| of it, thus forming a work based on the Program, and copy and
| distribute such modifications or work under the terms of Section 1
| above, provided that you also meet all of these conditions:
|
| a) You must cause the modified files to carry prominent notices
| stating that you changed the files and the date of any change.
|
| b) You must cause any work that you distribute or publish, that in
| whole or in part contains or is derived from the Program or any
| part thereof, to be licensed as a whole at no charge to all third
| parties under the terms of this License.
|
| c) If the modified program normally reads commands interactively
| when run, you must cause it, when started running for such
| interactive use in the most ordinary way, to print or display an
| announcement including an appropriate copyright notice and a
| notice that there is no warranty (or else, saying that you provide
| a warranty) and that users may redistribute the program under
| these conditions, and telling the user how to view a copy of this
| License. (Exception: if the Program itself is interactive but
| does not normally print such an announcement, your work based on
| the Program is not required to print an announcement.)

Offline

#179 2011-08-20 22:44:08

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: catwm, Cute and Tiny Window Manager

@el mariachi  I never found dwm to be that light and it seemed to be more complicated than I need with the tagging etc so this wm with a few additions/revisions works fine for me.
@ mhertz  Thanks for that smile I've added the date I started changing catwm to the files on github so I think I have that covered now.
Cheers


You're just jealous because the voices only talk to me.

Offline

#180 2011-08-20 23:06:41

el mariachi
Member
Registered: 2007-11-30
Posts: 595

Re: catwm, Cute and Tiny Window Manager

There is another CatWM?! It's such a good name smile
It's funny that you said DWM isn't that light haha it really shows that we're playing in a whole different league with these WM's xD

I must say this may in fact replace DWM for me.. just one or two things I miss from DWM and that's it

Last edited by el mariachi (2011-08-20 23:07:00)

Offline

#181 2011-08-21 01:35:41

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: catwm, Cute and Tiny Window Manager

moetunes wrote:

I'd appreciate an idea of the sort of references required as the whole framework is pyknites' but I can't say that he is still interested in it so I don't want to include his email address e.g. Or should I just still call it catwm ?

What you have right now looks fine. I hate to seem like a licensing Nazi, but I felt that credit should be given to pyknite. Wonderful job on the wm by the way. smile Cheers!

Offline

#182 2011-08-21 08:48:09

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: catwm, Cute and Tiny Window Manager

@el mariachi  there's not much to change for a top panel just a few lines in the tile() function

void tile() {
    client *c;
    int n = 0;
    int x = 0;

    // If only one window
    if(head != NULL && head->next == NULL) {
        XMoveResizeWindow(dis,head->win,0,PANEL_HEIGHT,sw-BORDER_WIDTH,sh-BORDER_WIDTH);
    }
    else if(head != NULL) {
        switch(mode) {
            case 0: /* Horizontal */
                // Master window
                XMoveResizeWindow(dis,head->win,0,PANEL_HEIGHT,sw-BORDER_WIDTH,master_size - BORDER_WIDTH);

                // Stack
                for(c=head->next;c;c=c->next) ++n;
                for(c=head->next;c;c=c->next) {
                    XMoveResizeWindow(dis,c->win,x,PANEL_HEIGHT+master_size + BORDER_WIDTH,(sw/n) - BORDER_WIDTH,sh-master_size - (2 * BORDER_WIDTH));
                    x += sw/n;
                }
                break;
            case 1: /* Fullscreen */
                for(c=head;c;c=c->next) {
                    XMoveResizeWindow(dis,c->win,0,PANEL_HEIGHT,sw-2*BORDER_WIDTH,sh-2*BORDER_WIDTH);
                }
                break;
            case 2: /* Vertical */
            	// Master window
                XMoveResizeWindow(dis,head->win,0,PANEL_HEIGHT,master_size - BORDER_WIDTH,sh - BORDER_WIDTH);

                // Stack
                for(c=head->next;c;c=c->next) ++n;
                x = PANEL_HEIGHT;
                for(c=head->next;c;c=c->next) {
                    XMoveResizeWindow(dis,c->win,master_size + BORDER_WIDTH,x,sw-master_size-(2*BORDER_WIDTH),(sh/n) - BORDER_WIDTH);
                    x += sh/n;
                }
                break;
            default:
                break;
        }
    }
}

and start your conky|dzen or whatever you want to use up the top smile


You're just jealous because the voices only talk to me.

Offline

#183 2011-08-21 09:34:52

el mariachi
Member
Registered: 2007-11-30
Posts: 595

Re: catwm, Cute and Tiny Window Manager

Thanks Moe! It won't compile though:

catwm.c: In function ‘tile’:
catwm.c:610:43: error: ‘PANEL_HEIGHT’ undeclared (first use in this function)
catwm.c:610:43: note: each undeclared identifier is reported only once for each function it appears in
catwm.c:610:59: error: ‘BORDER_WIDTH’ undeclared (first use in this function)
make: *** [catwm.o] Error 1

Shouldn't something be added to config.h too?

@mhertz: only 300kb of ram cool big_smile next to the monsterous 30mb of xorg and the biblic 300mb of chromium xD

Last edited by el mariachi (2011-08-21 09:41:27)

Offline

#184 2011-08-21 09:51:46

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: catwm, Cute and Tiny Window Manager

el mariachi wrote:

Thanks Moe! It won't compile though:

catwm.c: In function ‘tile’:
catwm.c:610:43: error: ‘PANEL_HEIGHT’ undeclared (first use in this function)
catwm.c:610:43: note: each undeclared identifier is reported only once for each function it appears in
catwm.c:610:59: error: ‘BORDER_WIDTH’ undeclared (first use in this function)
make: *** [catwm.o] Error 1

Shouldn't something be added to config.h too?

Yes.
The easiest way to fix it would be to grab the files from github and then change the tile() function so everything is there.
You could try to just add

#define BORDER_WIDTH 2
#define PANEL_HEIGHT 20 

to config.h but I don't know what else you're missing.

edit: I've updated the window manager el mariachi and host it on github so will be working from that smile

Last edited by moetunes (2011-08-21 10:01:19)


You're just jealous because the voices only talk to me.

Offline

#185 2011-08-21 10:26:39

el mariachi
Member
Registered: 2007-11-30
Posts: 595

Re: catwm, Cute and Tiny Window Manager

Thank you! I'll try it as soon as I can. I wouldn't like this to be added as a feature if I'm the only one around that likes it :S I don't want to be the one that starts chubbying up the cat tongue

btw is pyknite unreachable? catwm is such a good name..

Last edited by el mariachi (2011-08-21 10:37:30)

Offline

#186 2011-08-21 11:03:46

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: catwm, Cute and Tiny Window Manager

el mariachi wrote:

Thank you! I'll try it as soon as I can. I wouldn't like this to be added as a feature if I'm the only one around that likes it :S I don't want to be the one that starts chubbying up the cat tongue

btw is pyknite unreachable? catwm is such a good name..

Basically all I've been doing is adding things to the window manager that would let me configure it like I wanted. As I mainly use a pent3 700mhz laptop with 256mB ram I appreciate a light wm but catwm needed some more options for me so I added them. I fixed a bad window error crashing the wm, fixed numlock being on stopping the keyboard shortcuts from working and added an option to focus the window the mouse moves to if the option is set in the config file without adding much to the resources used at all. Adding an option for a top panel in the config would only be an extra few lines of code and the c file is still under 800 lines so I'd be happy to add it. smile

Cheers

edit: updated git with an option in the config for the panel to be at the top - added 6 lines of code smile

Last edited by moetunes (2011-08-21 11:17:21)


You're just jealous because the voices only talk to me.

Offline

#187 2011-08-21 14:21:29

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: catwm, Cute and Tiny Window Manager

Not that the name matters when the code is good, but personally, i've always hated the name catwm and the "cute" in "cute and tiny wm", so i'm glad you changed it... smile

The new name imho is great!

Btw, i'm still using musca as my only vm, but I love dminiwm as an automatic tiler, and have just set up arch with dminiwm for my father, which wanted automatic-tiling...

Offline

#188 2011-08-21 14:41:23

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: catwm, Cute and Tiny Window Manager

@moetunes

Sorry mate, the relevant gpl section i posted earlier for you, where from gpl-v2, whereas catwm is licensed under gpl-v3...

Relevant part from gpl-v3:

5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:

a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.

The "meaning" is the same, though, so no probs...

Offline

#189 2011-08-21 18:56:15

el mariachi
Member
Registered: 2007-11-30
Posts: 595

Re: catwm, Cute and Tiny Window Manager

I modified it so that it installs as catwm in my system tongue to each his own tongue not that dminiwm has anything wrong ..

Moe: thanks for the panel mate (again). I think I'm fairly happy with it. Taggin in dwm helps, but this flies big_smile

Offline

#190 2011-08-21 21:06:52

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: catwm, Cute and Tiny Window Manager

el mariachi wrote:

I modified it so that it installs as catwm in my system tongue to each his own tongue not that dminiwm has anything wrong ..

HAHA, cool! Yeah, it's probably just me being a little weird here! smile

CU, Martin.

Offline

#191 2011-08-25 03:35:39

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: catwm, Cute and Tiny Window Manager

I've got the xcb port up and running with numerical keyboard shortcuts at
github if anyone wants a try of it.
I'll make a post about it once I've got the readme properly sorted.
Cheers

Last edited by moetunes (2011-08-25 03:36:07)


You're just jealous because the voices only talk to me.

Offline

#192 2011-08-25 08:26:33

el mariachi
Member
Registered: 2007-11-30
Posts: 595

Re: catwm, Cute and Tiny Window Manager

wink will try it later, thanks moe.

@later: humm the keys are not working for me.. tty1 isn't showing any error message and compilation was smooth. I used xev to find out the keycodes. I can't launch anything.
Missing lib?

Last edited by el mariachi (2011-08-25 09:37:10)

Offline

#193 2011-09-07 00:58:04

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: catwm, Cute and Tiny Window Manager

I've fixed up the ghost/zombie window issue and added the grid tiling mode from the xcb port.
For those interested in the code the catwm remove_window function didn't save the desktop if there was just one window. Once that was fixed it was just a matter of going through the desktops in the destroynotify function until the window being destroyed was found.
It's here.
Cheers

Last edited by moetunes (2011-09-07 07:55:35)


You're just jealous because the voices only talk to me.

Offline

#194 2011-09-07 04:46:37

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: catwm, Cute and Tiny Window Manager

There were a couple of bugs with the above fix which are sorted now.
I'm happy that this is now at a stable enough stage for development in new directions.
Cheers


You're just jealous because the voices only talk to me.

Offline

#195 2011-09-14 00:22:32

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,033

Re: catwm, Cute and Tiny Window Manager

I'm taking my window manager chatter to this thread.
Cheers


You're just jealous because the voices only talk to me.

Offline

#196 2011-12-29 17:59:45

sunaku
Member
From: /dev/tty
Registered: 2010-09-29
Posts: 140
Website

Re: catwm, Cute and Tiny Window Manager

Hey pyknite, you forgot to retain the DWM copyright notice when you forked catwm from DWM.  Please add it to honor your predecessors and the law! cool

Offline

#197 2012-03-13 18:21:21

Beastie
Member
Registered: 2012-01-14
Posts: 39

Re: catwm, Cute and Tiny Window Manager

very nice minimal wm with only 600+  loc big_smile

btw if anyone wants to compile it on osx, these are the options you'll need:

cc -o catwm -g -std=c99 -pedantic --L/usr/lib -lc -L/opt/X11/lib -lX11 -Wall catwm.o

Offline

#198 2012-03-13 18:49:08

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: catwm, Cute and Tiny Window Manager

If you liked catwm, maybe you'll also enjoy dminiwm and snapwm and monsterwm that picked up from catwm wink


.:[ git me! ] :.

Offline

#199 2012-03-14 08:13:28

Beastie
Member
Registered: 2012-01-14
Posts: 39

Re: catwm, Cute and Tiny Window Manager

i did, i tried them all big_smile on osx, slack, freebsd. smile they worked fine but i need good xinerama support so i use dwm/xmonad for the moment tongue

Offline

#200 2012-03-28 07:32:05

pyknite
Member
Registered: 2010-03-03
Posts: 166

Re: catwm, Cute and Tiny Window Manager

Beastie wrote:

i did, i tried them all big_smile on osx, slack, freebsd. smile they worked fine but i need good xinerama support so i use dwm/xmonad for the moment tongue

Hi, I tried to add some xinerama support a few month ago... I never finished it but if I remember, it was "almost" working (I mean, it detect screens, run the wm on both screens, but the management of window wasn't finished)... Have a look if you're still interested:

#include <X11/Xlib.h>
#include <X11/keysym.h>
#include <X11/XF86keysym.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/wait.h>

// Screen managed by Xinerama
#ifdef XINERAMA
#include <X11/extensions/Xinerama.h>
#endif

// Screen managed by Xrandr
#ifdef XRANDR
#include <X11/extensions/Xrandr.h>
#endif


#define TABLENGTH(X)    (sizeof(X)/sizeof(*X))

typedef struct client client;
struct client {
	client *next;
	client *prev;

	Window w;
};

typedef struct view view;
struct view {
	client *head;
	client *cur;

	int mode;
};

typedef struct monitor monitor;
struct monitor {
	int sw;
	int sh;
	int x;
	int y;
	
	view views[10];
};

typedef union {
	const char** com;
	const int i;
} Arg;

struct key {
	unsigned int mod;
	KeySym keysym;
	void (*function)(const Arg arg);
	const Arg arg;
};

// Include configuration file (need struct key)
#include "config.h"

// Variable
static Display *dis;
static int bool_quit;
static int current_monitor;
static monitor *monitors;
static int monitors_count;
static int screen;
static Window root;

// Events array
static void (*events[LASTEvent])(XEvent *e) = {
	[KeyPress] = keypress,
	[MapRequest] = maprequest,
	[DestroyNotify] = destroynotify,
	[ConfigureNotify] = configurenotify,
	[ConfigureRequest] = configurerequest,
};

void setup() {
	// Install a signal
	sigchld(0);

	monitors_count = 0;
	current_monitor = 0;
	update_monitors();

	screen = DefaultScreen(dis);
	root = RootWindow(dis,screen);

	// For exiting
	bool_quit = 0;

	grabkeys();

	// To catch maprequest,destroynotify, xrandr events,...
	XSelectInput(dis,root,StructureNotifyMask|SubstructureNotifyMask|SubstructureRedirectMask|PropertyChangeMask);
}


void update_monitors() {
#ifdef XINERAMA
	if(XineramaIsActive(dis)) {
		int i,count=0;
		XineramaScreenInfo *info = NULL;

		// Get numbers of monitors and some info
		if(!(info = XineramaQueryScreens(dis, &count)))
			die("Error XineramaQueryScreens!");

		// Update
		if(count == monitors_count) {
			for(i=0;i<count;++i) {
				monitors[i].sw = info[i].width;
				monitors[i].sh = info[i].height;
				monitors[i].x = info[i].x_org;
				monitors[i].y = info[i].y_org;
			}
		}
		// More monitors
		else if(count > monitors_count) {
			if(!(monitors = (monitor*)realloc(monitors,count*sizeof(monitor))))
				die("Error realloc!");

			// Update monitors info (only new monitors)
			for(i=count-(count-monitors_count);i<count;++i) {
				monitors[i].sw = info[i].width;
				monitors[i].sh = info[i].height;
				monitors[i].x = info[i].x_org;
				monitors[i].y = info[i].y_org;
				monitors[i].current =monitors[i].head = NULL;
			}
		}
		// Less monitors (realloc client to first monitor)
		else if(count < monitors_count) {			
			if(!(monitors = (monitor*)realloc(monitors,count*sizeof(monitor))))
				die("Error realloc!");
		}

		// Updatge monitors_count
		monitors_count = count;
		XFree(info);
	}
#endif

#ifdef XRANDR
	die("XRANDR extensensions not yet implemented!");
#endif
}

Offline

Board footer

Powered by FluxBB