2007-12-10 13:43:28 +01:00
|
|
|
/*
|
2007-09-12 14:29:51 +02:00
|
|
|
* config.h - configuration management header
|
2007-10-03 17:26:14 +02:00
|
|
|
*
|
2008-01-02 16:59:43 +01:00
|
|
|
* Copyright © 2007-2008 Julien Danjou <julien@danjou.info>
|
2007-10-03 17:26:14 +02:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
2007-09-12 14:29:51 +02:00
|
|
|
*/
|
2007-09-05 20:15:00 +02:00
|
|
|
|
2007-09-10 16:11:57 +02:00
|
|
|
#ifndef AWESOME_CONFIG_H
|
|
|
|
#define AWESOME_CONFIG_H
|
2007-09-05 20:15:00 +02:00
|
|
|
|
2007-10-15 12:40:45 +02:00
|
|
|
#include <regex.h>
|
2007-12-27 17:12:49 +01:00
|
|
|
#include "draw.h"
|
2008-01-01 17:37:16 +01:00
|
|
|
#include "layout.h"
|
2007-09-05 20:15:00 +02:00
|
|
|
|
|
|
|
/** Bar possible position */
|
2008-01-04 19:12:07 +01:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
Top,
|
|
|
|
Bottom,
|
|
|
|
Left,
|
|
|
|
Right,
|
|
|
|
Off
|
|
|
|
} Position;
|
2007-09-05 20:15:00 +02:00
|
|
|
|
2007-12-23 15:16:10 +01:00
|
|
|
/** Common colors */
|
2007-09-05 20:15:00 +02:00
|
|
|
enum
|
2007-12-23 15:16:10 +01:00
|
|
|
{ ColBorder, ColFG, ColBG, ColLast };
|
2007-09-05 20:15:00 +02:00
|
|
|
|
2007-10-03 17:26:14 +02:00
|
|
|
enum
|
|
|
|
{ CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
2007-09-12 18:16:20 +02:00
|
|
|
|
2007-11-12 19:25:10 +01:00
|
|
|
typedef struct Rule Rule;
|
|
|
|
struct Rule
|
2007-09-05 20:15:00 +02:00
|
|
|
{
|
2007-12-29 19:44:15 +01:00
|
|
|
char *icon;
|
2008-01-02 12:23:01 +01:00
|
|
|
char *xprop;
|
2007-11-12 18:21:03 +01:00
|
|
|
int screen;
|
2007-09-05 20:15:00 +02:00
|
|
|
Bool isfloating;
|
2008-01-02 12:00:36 +01:00
|
|
|
Bool not_master;
|
2008-01-02 12:44:18 +01:00
|
|
|
regex_t *prop_r;
|
|
|
|
regex_t *tags_r;
|
|
|
|
regex_t *xpropval_r;
|
2007-11-12 19:25:10 +01:00
|
|
|
Rule *next;
|
|
|
|
};
|
2007-09-05 20:15:00 +02:00
|
|
|
|
2007-12-19 04:46:44 +01:00
|
|
|
typedef struct AwesomeConf AwesomeConf;
|
2007-09-05 20:15:00 +02:00
|
|
|
|
2007-11-12 17:22:40 +01:00
|
|
|
typedef struct Key Key;
|
|
|
|
struct Key
|
2007-09-05 20:15:00 +02:00
|
|
|
{
|
|
|
|
unsigned long mod;
|
|
|
|
KeySym keysym;
|
2008-01-01 17:37:16 +01:00
|
|
|
Uicb *func;
|
2007-09-16 23:12:53 +02:00
|
|
|
char *arg;
|
2007-11-12 17:22:40 +01:00
|
|
|
Key *next;
|
|
|
|
};
|
2007-09-05 20:15:00 +02:00
|
|
|
|
2007-11-11 15:40:01 +01:00
|
|
|
typedef struct Button Button;
|
|
|
|
struct Button
|
|
|
|
{
|
|
|
|
unsigned long mod;
|
|
|
|
unsigned int button;
|
2008-01-01 17:37:16 +01:00
|
|
|
Uicb *func;
|
2007-11-11 15:40:01 +01:00
|
|
|
char *arg;
|
2007-11-12 13:21:28 +01:00
|
|
|
Button *next;
|
2007-11-11 15:40:01 +01:00
|
|
|
};
|
|
|
|
|
2007-12-30 21:00:34 +01:00
|
|
|
/** Widget */
|
2007-12-15 07:53:53 +01:00
|
|
|
typedef struct Widget Widget;
|
2007-12-30 21:00:34 +01:00
|
|
|
typedef struct Statusbar Statusbar;
|
|
|
|
struct Widget
|
|
|
|
{
|
|
|
|
/** Widget name */
|
|
|
|
char *name;
|
|
|
|
/** Draw function */
|
|
|
|
int (*draw)(Widget *, DrawCtx *, int, int);
|
|
|
|
/** Update function */
|
|
|
|
void (*tell)(Widget *, char *);
|
|
|
|
/** ButtonPressedEvent handler */
|
|
|
|
void (*button_press)(Widget *, XButtonPressedEvent *);
|
|
|
|
/** Statusbar */
|
|
|
|
Statusbar *statusbar;
|
|
|
|
/** Alignement */
|
2008-01-04 19:17:20 +01:00
|
|
|
Alignment alignment;
|
2007-12-30 21:00:34 +01:00
|
|
|
/** Misc private data */
|
|
|
|
void *data;
|
2008-01-05 12:35:12 +01:00
|
|
|
/** True if user supplied coords */
|
|
|
|
Bool user_supplied_x;
|
|
|
|
Bool user_supplied_y;
|
2008-01-04 21:46:25 +01:00
|
|
|
/** Area */
|
|
|
|
Area area;
|
2007-12-30 21:00:34 +01:00
|
|
|
/** Buttons bindings */
|
|
|
|
Button *buttons;
|
|
|
|
/** Font */
|
|
|
|
XftFont *font;
|
|
|
|
/** Next widget */
|
|
|
|
Widget *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
/** Status bar */
|
|
|
|
struct Statusbar
|
2007-09-07 16:13:59 +02:00
|
|
|
{
|
2007-12-30 21:00:34 +01:00
|
|
|
/** Statusbar name */
|
|
|
|
char *name;
|
2007-09-07 16:35:46 +02:00
|
|
|
/** Bar width */
|
2007-09-07 16:13:59 +02:00
|
|
|
int width;
|
2007-09-07 16:35:46 +02:00
|
|
|
/** Bar height */
|
2007-09-07 16:13:59 +02:00
|
|
|
int height;
|
2007-10-10 19:59:14 +02:00
|
|
|
/** Layout txt width */
|
|
|
|
int txtlayoutwidth;
|
2007-11-10 10:17:54 +01:00
|
|
|
/** Default position */
|
2008-01-04 19:12:07 +01:00
|
|
|
Position dposition;
|
2007-09-07 16:35:46 +02:00
|
|
|
/** Bar position */
|
2008-01-04 19:12:07 +01:00
|
|
|
Position position;
|
2007-09-07 17:29:36 +02:00
|
|
|
/** Window */
|
|
|
|
Window window;
|
2007-09-15 23:04:04 +02:00
|
|
|
/** Screen */
|
|
|
|
int screen;
|
2007-12-30 12:26:11 +01:00
|
|
|
/** Widget list */
|
2007-12-15 22:28:40 +01:00
|
|
|
Widget *widgets;
|
2007-12-30 12:26:11 +01:00
|
|
|
/** Drawable */
|
|
|
|
Drawable drawable;
|
2007-12-30 21:00:34 +01:00
|
|
|
/** Next statusbar */
|
|
|
|
Statusbar *next;
|
|
|
|
};
|
2007-09-07 16:13:59 +02:00
|
|
|
|
2007-10-11 21:50:32 +02:00
|
|
|
typedef struct Client Client;
|
|
|
|
struct Client
|
|
|
|
{
|
|
|
|
/** Client name */
|
|
|
|
char name[256];
|
|
|
|
/** Window geometry */
|
2008-01-05 19:38:50 +01:00
|
|
|
Area geometry;
|
|
|
|
/** Floating window geometry */
|
|
|
|
Area f_geometry;
|
|
|
|
/** Max window geometry */
|
|
|
|
Area m_geometry;
|
2007-10-11 21:50:32 +02:00
|
|
|
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
|
|
|
|
int minax, maxax, minay, maxay;
|
|
|
|
int border, oldborder;
|
2007-12-23 15:16:10 +01:00
|
|
|
/** Has urgency hint */
|
|
|
|
Bool isurgent;
|
2007-10-22 11:21:27 +02:00
|
|
|
/** Store previous floating state before maximizing */
|
|
|
|
Bool wasfloating;
|
|
|
|
/** True if the window is floating */
|
|
|
|
Bool isfloating;
|
|
|
|
/** True if the window is fixed */
|
|
|
|
Bool isfixed;
|
|
|
|
/** True if the window is maximized */
|
|
|
|
Bool ismax;
|
2007-12-28 13:43:47 +01:00
|
|
|
/** True if the client must be skipped from client list */
|
|
|
|
Bool skip;
|
2008-01-03 13:15:15 +01:00
|
|
|
/** True if the client must be skipped from task bar client list */
|
|
|
|
Bool skiptb;
|
2007-10-11 21:50:32 +02:00
|
|
|
/** Next client */
|
|
|
|
Client *next;
|
|
|
|
/** Previous client */
|
|
|
|
Client *prev;
|
|
|
|
/** Window of the client */
|
|
|
|
Window win;
|
|
|
|
/** Client logical screen */
|
|
|
|
int screen;
|
|
|
|
};
|
|
|
|
|
2007-12-14 21:51:54 +01:00
|
|
|
typedef struct FocusList FocusList;
|
|
|
|
struct FocusList
|
|
|
|
{
|
|
|
|
Client *client;
|
|
|
|
FocusList *prev;
|
|
|
|
};
|
|
|
|
|
2007-10-25 19:47:37 +02:00
|
|
|
/** Tag type */
|
2007-12-14 19:02:38 +01:00
|
|
|
typedef struct Tag Tag;
|
|
|
|
struct Tag
|
2007-10-25 19:47:37 +02:00
|
|
|
{
|
|
|
|
/** Tag name */
|
|
|
|
char *name;
|
|
|
|
/** True if selected */
|
|
|
|
Bool selected;
|
|
|
|
/** True if was selected before selecting others tags */
|
|
|
|
Bool was_selected;
|
|
|
|
/** Current tag layout */
|
|
|
|
Layout *layout;
|
2007-11-11 11:48:26 +01:00
|
|
|
/** Master width factor */
|
|
|
|
double mwfact;
|
2007-11-11 11:53:10 +01:00
|
|
|
/** Number of master windows */
|
|
|
|
int nmaster;
|
2007-11-11 11:55:20 +01:00
|
|
|
/** Number of columns in tile layout */
|
|
|
|
int ncol;
|
2007-12-14 19:02:38 +01:00
|
|
|
/** Next tag */
|
|
|
|
Tag *next;
|
|
|
|
};
|
2007-10-25 19:47:37 +02:00
|
|
|
|
2007-12-14 14:29:32 +01:00
|
|
|
/** TagClientLink type */
|
|
|
|
typedef struct TagClientLink TagClientLink;
|
|
|
|
struct TagClientLink
|
|
|
|
{
|
|
|
|
Tag *tag;
|
|
|
|
Client *client;
|
|
|
|
TagClientLink *next;
|
|
|
|
};
|
|
|
|
|
2007-11-27 23:03:55 +01:00
|
|
|
/** Padding type */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
/** Padding at top */
|
|
|
|
int top;
|
|
|
|
/** Padding at bottom */
|
|
|
|
int bottom;
|
|
|
|
/** Padding at left */
|
|
|
|
int left;
|
|
|
|
/** Padding at right */
|
|
|
|
int right;
|
|
|
|
} Padding;
|
|
|
|
|
2007-12-11 20:56:51 +01:00
|
|
|
typedef struct
|
2007-09-05 20:15:00 +02:00
|
|
|
{
|
2007-12-11 20:56:51 +01:00
|
|
|
/** Number of pixels to snap windows */
|
|
|
|
int snap;
|
|
|
|
/** Border size */
|
|
|
|
int borderpx;
|
|
|
|
/** Transparency of unfocused clients */
|
|
|
|
int opacity_unfocused;
|
|
|
|
/** Focus move pointer */
|
|
|
|
Bool focus_move_pointer;
|
|
|
|
/** Allow floats to be lowered on focus change */
|
|
|
|
Bool allow_lower_floats;
|
|
|
|
/** Respect resize hints */
|
|
|
|
Bool resize_hints;
|
2008-01-04 14:40:26 +01:00
|
|
|
/** Sloppy focus: focus follow mouse */
|
|
|
|
Bool sloppy_focus;
|
2008-01-04 17:53:28 +01:00
|
|
|
/** True if new clients should become master */
|
|
|
|
Bool new_become_master;
|
2007-12-11 20:56:51 +01:00
|
|
|
/** Normal colors */
|
|
|
|
XColor colors_normal[ColLast];
|
|
|
|
/** Selected colors */
|
|
|
|
XColor colors_selected[ColLast];
|
2007-12-23 15:16:10 +01:00
|
|
|
/** Urgency colors */
|
|
|
|
XColor colors_urgent[ColLast];
|
2007-09-05 20:15:00 +02:00
|
|
|
/** Tag list */
|
2007-09-24 15:37:52 +02:00
|
|
|
Tag *tags;
|
2007-09-05 20:15:00 +02:00
|
|
|
/** Layout list */
|
|
|
|
Layout *layouts;
|
2007-12-11 20:56:51 +01:00
|
|
|
/** Status bar */
|
2007-12-18 08:17:46 +01:00
|
|
|
Statusbar *statusbar;
|
2007-12-11 20:56:51 +01:00
|
|
|
/** Padding */
|
|
|
|
Padding padding;
|
|
|
|
/** Font */
|
|
|
|
XftFont *font;
|
|
|
|
} VirtScreen;
|
|
|
|
|
|
|
|
/** Main configuration structure */
|
2007-12-19 04:46:44 +01:00
|
|
|
struct AwesomeConf
|
2007-12-11 20:56:51 +01:00
|
|
|
{
|
|
|
|
/** Display ref */
|
|
|
|
Display *display;
|
|
|
|
/** Logical screens */
|
|
|
|
VirtScreen *screens;
|
2007-09-05 20:15:00 +02:00
|
|
|
/** Rules list */
|
|
|
|
Rule *rules;
|
2007-11-11 15:40:01 +01:00
|
|
|
/** Keys bindings list */
|
2007-09-05 20:15:00 +02:00
|
|
|
Key *keys;
|
2007-11-11 15:40:01 +01:00
|
|
|
/** Mouse bindings list */
|
|
|
|
struct
|
|
|
|
{
|
2007-11-12 10:53:48 +01:00
|
|
|
Button *root;
|
2007-11-14 17:18:16 +01:00
|
|
|
Button *client;
|
2007-11-11 15:40:01 +01:00
|
|
|
} buttons;
|
2007-09-05 20:15:00 +02:00
|
|
|
/** Numlock mask */
|
|
|
|
unsigned int numlockmask;
|
2007-09-13 15:57:35 +02:00
|
|
|
/** Check for XShape extension */
|
|
|
|
Bool have_shape;
|
2007-09-13 16:00:03 +02:00
|
|
|
/** Check for XRandR extension */
|
|
|
|
Bool have_randr;
|
2007-10-10 13:29:46 +02:00
|
|
|
/** Cursors */
|
|
|
|
Cursor cursor[CurLast];
|
2007-10-11 21:50:32 +02:00
|
|
|
/** Clients list */
|
2007-12-11 20:56:51 +01:00
|
|
|
Client *clients;
|
2007-10-31 11:37:38 +01:00
|
|
|
/** Path to config file */
|
|
|
|
char *configpath;
|
2007-12-14 21:51:54 +01:00
|
|
|
/** Selected clients on this tag */
|
|
|
|
FocusList *focus;
|
2007-12-28 11:34:35 +01:00
|
|
|
/** Link between tags and clients */
|
|
|
|
TagClientLink *tclink;
|
2007-09-05 20:15:00 +02:00
|
|
|
};
|
|
|
|
|
2007-12-16 13:22:13 +01:00
|
|
|
void config_parse(const char *);
|
2007-09-05 20:15:00 +02:00
|
|
|
|
|
|
|
#endif
|
2007-12-18 09:24:15 +01:00
|
|
|
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|