diff --git a/awesomerc b/awesomerc index 6c253313..2320cc24 100644 --- a/awesomerc +++ b/awesomerc @@ -27,6 +27,7 @@ awesome: layouts = ( ("[]=", "tile"), ("=[]", "tileleft"), + ("[ ]", "max"), ("><>", "floating") ); diff --git a/config.c b/config.c index 8a83ce5c..8f0b6b15 100644 --- a/config.c +++ b/config.c @@ -34,6 +34,7 @@ #include "util.h" #include "statusbar.h" #include "layouts/tile.h" +#include "layouts/max.h" #include "layouts/floating.h" static void initfont(const char *, Display *, DC *); @@ -73,6 +74,7 @@ static const NameFuncLink LayoutsList[] = { {"tile", layout_tile}, {"tileleft", layout_tileleft}, + {"max", layout_max}, {"floating", layout_floating}, {NULL, NULL} }; diff --git a/config.mk b/config.mk index d3d23106..8bcfb804 100644 --- a/config.mk +++ b/config.mk @@ -4,7 +4,7 @@ VERSION = devel # Customize below to fit your system # additional layouts beside floating -LAYOUTS = layouts/tile.c layouts/floating.c +LAYOUTS = layouts/tile.c layouts/floating.c layouts/max.c # paths PREFIX = /usr/local diff --git a/layouts/floating.c b/layouts/floating.c index 1652c1a8..7ee5af7f 100644 --- a/layouts/floating.c +++ b/layouts/floating.c @@ -2,7 +2,6 @@ * floating.c - floating layout * * Copyright © 2007 Julien Danjou - * Copyright © 2007 Alexandru E. Ungur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/layouts/max.c b/layouts/max.c new file mode 100644 index 00000000..95d927d0 --- /dev/null +++ b/layouts/max.c @@ -0,0 +1,42 @@ +/* + * max.c - max layout + * + * Copyright © 2007 Julien Danjou + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include "tag.h" +#include "screen.h" +#include "layouts/max.h" + +/* extern */ +extern Client *clients; /* global client */ + +void +layout_max(Display *disp, awesome_config *awesomeconf) +{ + Client *c; + int dummy; + ScreenInfo *si = get_screen_info(disp, awesomeconf->screen, awesomeconf->statusbar, &dummy); + + for(c = clients; c; c = c->next) + if(IS_TILED(c, awesomeconf->screen, awesomeconf->selected_tags, awesomeconf->ntags)) + resize(c, si[awesomeconf->screen].x_org, si[awesomeconf->screen].y_org, + si[awesomeconf->screen].width - 2 * c->border, + si[awesomeconf->screen].height - 2 * c->border, awesomeconf->resize_hints); + XFree(si); +} diff --git a/layouts/max.h b/layouts/max.h new file mode 100644 index 00000000..e3d5d5f1 --- /dev/null +++ b/layouts/max.h @@ -0,0 +1,27 @@ +/* + * max.h - max layout header + * + * Copyright © 2007 Julien Danjou + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#ifndef AWESOME_MAX_H +#define AWESOME_MAX_H + +void layout_max(Display *, awesome_config *); + +#endif