2007-10-03 17:26:14 +02:00
|
|
|
/*
|
2007-09-12 14:29:51 +02:00
|
|
|
* config.h - configuration management header
|
2007-10-03 17:26:14 +02:00
|
|
|
*
|
|
|
|
* 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-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-09-10 16:11:57 +02:00
|
|
|
#define AWESOME_CONFIG_FILE ".awesomerc"
|
2007-09-05 20:15:00 +02:00
|
|
|
|
|
|
|
#include <X11/Xlib.h>
|
2007-10-01 19:22:57 +02:00
|
|
|
#include <X11/Xft/Xft.h>
|
2007-09-05 20:15:00 +02:00
|
|
|
|
|
|
|
/** Bar possible position */
|
|
|
|
enum
|
|
|
|
{ BarTop, BarBot, BarOff };
|
|
|
|
|
|
|
|
enum
|
|
|
|
{ ColBorder, ColFG, ColBG, ColLast }; /* color */
|
|
|
|
|
2007-10-03 17:26:14 +02:00
|
|
|
enum
|
|
|
|
{ CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
2007-09-12 18:16:20 +02:00
|
|
|
|
2007-09-05 20:15:00 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GC gc;
|
2007-09-12 18:16:20 +02:00
|
|
|
Cursor cursor[CurLast];
|
2007-10-01 19:22:57 +02:00
|
|
|
XftFont *font;
|
2007-09-05 20:15:00 +02:00
|
|
|
} DC;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2007-09-16 23:12:53 +02:00
|
|
|
char *prop;
|
|
|
|
char *tags;
|
2007-09-05 20:15:00 +02:00
|
|
|
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
|
|
|
|
{
|
2007-09-16 23:12:53 +02:00
|
|
|
char *symbol;
|
2007-09-17 14:07:31 +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-17 13:58:49 +02:00
|
|
|
void (*func) (Display *, DC *, awesome_config *, char *);
|
2007-09-16 23:12:53 +02:00
|
|
|
char *arg;
|
2007-09-05 20:15:00 +02:00
|
|
|
} 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-15 14:58:41 +02:00
|
|
|
/** Drawable object */
|
|
|
|
Drawable drawable;
|
2007-09-15 23:04:04 +02:00
|
|
|
/** Screen */
|
|
|
|
int screen;
|
2007-09-07 16:13:59 +02:00
|
|
|
} Statusbar;
|
|
|
|
|
2007-09-24 15:37:52 +02:00
|
|
|
/** Tag type */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
/** 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;
|
|
|
|
} Tag;
|
|
|
|
|
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
|
|
|
{
|
2007-10-01 15:31:43 +02:00
|
|
|
/** Display ref */
|
|
|
|
Display *display;
|
2007-10-01 15:23:05 +02:00
|
|
|
/** Config virtual screen number */
|
2007-09-16 23:12:53 +02:00
|
|
|
int screen;
|
2007-10-01 15:23:05 +02:00
|
|
|
/** Config physical screen */
|
|
|
|
int phys_screen;
|
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
|
|
|
/** Number of tags in **tags */
|
|
|
|
int ntags;
|
|
|
|
/** Layout list */
|
|
|
|
Layout *layouts;
|
|
|
|
/** Number of layouts in *layouts */
|
|
|
|
int nlayouts;
|
|
|
|
/** 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 */
|
2007-10-03 17:26:14 +02:00
|
|
|
KeySym modkey;
|
2007-09-05 20:15:00 +02:00
|
|
|
/** 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;
|
2007-09-15 13:04:36 +02:00
|
|
|
/** Number of columns in tile layout */
|
2007-10-08 18:45:05 +02:00
|
|
|
int ncol;
|
2007-09-05 20:15:00 +02:00
|
|
|
/** Transparency of unfocused clients */
|
|
|
|
int opacity_unfocused;
|
2007-10-08 14:25:36 +02:00
|
|
|
/** Focus move pointer */
|
|
|
|
Bool focus_move_pointer;
|
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-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:07:12 +02:00
|
|
|
/** Normal colors */
|
|
|
|
XColor colors_normal[ColLast];
|
|
|
|
/** Selected colors */
|
|
|
|
XColor colors_selected[ColLast];
|
2007-09-05 20:15:00 +02:00
|
|
|
};
|
|
|
|
|
2007-09-26 21:22:30 +02:00
|
|
|
void parse_config(Display *, int, DC *, const char *, awesome_config *); /* parse configuration file */
|
2007-09-05 20:15:00 +02:00
|
|
|
|
|
|
|
#endif
|