2007-09-12 14:29:51 +02:00
|
|
|
/*
|
|
|
|
* config.h - configuration management header
|
|
|
|
*
|
|
|
|
* Copyright © 2007 Julien Danjou <julien@danjou.info>
|
|
|
|
*
|
|
|
|
* 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-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-09-10 16:11:57 +02:00
|
|
|
#define AWESOME_CONFIG_FILE ".awesomerc"
|
2007-09-05 20:15:00 +02:00
|
|
|
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
|
|
|
|
/** Bar possible position */
|
|
|
|
enum
|
|
|
|
{ BarTop, BarBot, BarOff };
|
|
|
|
|
|
|
|
enum
|
|
|
|
{ ColBorder, ColFG, ColBG, ColLast }; /* color */
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int x, y, w, h;
|
|
|
|
unsigned long norm[ColLast];
|
|
|
|
unsigned long sel[ColLast];
|
|
|
|
Drawable drawable;
|
|
|
|
GC gc;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int ascent;
|
|
|
|
int descent;
|
|
|
|
int height;
|
|
|
|
XFontSet set;
|
|
|
|
XFontStruct *xfont;
|
|
|
|
} font;
|
|
|
|
} DC;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
const char *prop;
|
|
|
|
const char *tags;
|
|
|
|
Bool isfloating;
|
|
|
|
} Rule;
|
|
|
|
|
2007-09-10 12:06:54 +02:00
|
|
|
typedef struct awesome_config awesome_config;
|
2007-09-05 20:15:00 +02:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
const char *symbol;
|
2007-09-10 12:06:54 +02:00
|
|
|
void (*arrange) (Display *, awesome_config *);
|
2007-09-05 20:15:00 +02:00
|
|
|
} Layout;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
unsigned long mod;
|
|
|
|
KeySym keysym;
|
2007-09-12 18:11:27 +02:00
|
|
|
void (*func) (Display *, DC *, awesome_config *, const char *);
|
2007-09-05 20:15:00 +02:00
|
|
|
const char *arg;
|
|
|
|
} Key;
|
|
|
|
|
2007-09-07 16:13:59 +02:00
|
|
|
/** Status bar */
|
|
|
|
typedef struct
|
|
|
|
{
|
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-09-07 16:35:46 +02:00
|
|
|
/** Bar position */
|
|
|
|
int position;
|
2007-09-07 17:29:36 +02:00
|
|
|
/** Window */
|
|
|
|
Window window;
|
2007-09-07 16:13:59 +02:00
|
|
|
} Statusbar;
|
|
|
|
|
2007-09-05 20:15:00 +02:00
|
|
|
/** Main configuration structure */
|
2007-09-10 12:06:54 +02:00
|
|
|
struct awesome_config
|
2007-09-05 20:15:00 +02:00
|
|
|
{
|
|
|
|
/** Tag list */
|
|
|
|
const char **tags;
|
2007-09-06 19:05:26 +02:00
|
|
|
/** Selected tags */
|
|
|
|
Bool *selected_tags;
|
2007-09-06 19:09:09 +02:00
|
|
|
/* Previously selected tags */
|
|
|
|
Bool *prev_selected_tags;
|
2007-09-05 20:15:00 +02:00
|
|
|
/** Number of tags in **tags */
|
|
|
|
int ntags;
|
|
|
|
/** Layout list */
|
|
|
|
Layout *layouts;
|
|
|
|
/** Number of layouts in *layouts */
|
|
|
|
int nlayouts;
|
2007-09-06 21:53:45 +02:00
|
|
|
/** Store layout for eatch tag */
|
|
|
|
Layout **tag_layouts;
|
2007-09-05 20:15:00 +02:00
|
|
|
/** Rules list */
|
|
|
|
Rule *rules;
|
|
|
|
/** Number of rules in *rules */
|
|
|
|
int nrules;
|
|
|
|
/** Keys binding list */
|
|
|
|
Key *keys;
|
|
|
|
/** Number of keys binding in *keys */
|
|
|
|
int nkeys;
|
|
|
|
/** Default modkey */
|
|
|
|
KeySym modkey;
|
|
|
|
/** Numlock mask */
|
|
|
|
unsigned int numlockmask;
|
2007-09-07 16:35:46 +02:00
|
|
|
/** Default status bar position */
|
|
|
|
int statusbar_default_position;
|
2007-09-05 20:15:00 +02:00
|
|
|
/** Border size */
|
|
|
|
int borderpx;
|
|
|
|
/** Master width factor */
|
|
|
|
double mwfact;
|
|
|
|
/** Number of pixels to snap windows */
|
|
|
|
int snap;
|
|
|
|
/** Number of master windows */
|
|
|
|
int nmaster;
|
|
|
|
/** Transparency of unfocused clients */
|
|
|
|
int opacity_unfocused;
|
2007-09-10 12:01:36 +02:00
|
|
|
/** Respect resize hints */
|
|
|
|
Bool resize_hints;
|
2007-09-05 20:15:00 +02:00
|
|
|
/** Text displayed in bar */
|
|
|
|
char statustext[256];
|
|
|
|
/** Current layout */
|
|
|
|
Layout * current_layout;
|
2007-09-07 16:13:59 +02:00
|
|
|
/** Status bar */
|
|
|
|
Statusbar statusbar;
|
2007-09-05 20:15:00 +02:00
|
|
|
};
|
|
|
|
|
2007-09-10 12:06:54 +02:00
|
|
|
void parse_config(Display *, int, DC *, awesome_config *); /* parse configuration file */
|
2007-09-05 20:15:00 +02:00
|
|
|
|
|
|
|
#endif
|