Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 119 lines (109 sloc) 7.01 KB
/* see LICENSE for copyright and license */
#ifndef CONFIG_H
#define CONFIG_H
/** modifiers **/
#define MOD1 Mod1Mask /* ALT key */
#define MOD4 Mod4Mask /* Super/Windows key */
#define CONTROL ControlMask /* Control key */
#define SHIFT ShiftMask /* Shift key */
/** generic settings **/
#define MASTER_SIZE 0.55
#define SHOW_PANEL True /* show panel by default on exec */
#define TOP_PANEL True /* False means panel is on bottom */
#define PANEL_HEIGHT 15 /* 0 for no space for panel, thus no panel */
#define DEFAULT_MODE TILE /* initial layout/mode: TILE MONOCLE BSTACK GRID FLOAT */
#define ATTACH_ASIDE True /* False means new window is master */
#define FOLLOW_WINDOW False /* follow the window when moved to a different desktop */
#define FOLLOW_MOUSE False /* focus the window the mouse just entered */
#define CLICK_TO_FOCUS True /* focus an unfocused window when clicked */
#define FOCUS_BUTTON Button1 /* mouse button to be used along with CLICK_TO_FOCUS */
#define BORDER_WIDTH 2 /* window border width */
#define FOCUS "#8fe3ff" /* focused window border color */
#define UNFOCUS "#444444" /* unfocused window border color */
#define MINWSZ 50 /* minimum window size in pixels */
#define DEFAULT_DESKTOP 0 /* the desktop to focus initially */
#define DESKTOPS 4 /* number of desktops - edit DESKTOPCHANGE keys to suit */
/**
* open applications to specified desktop with specified mode.
* if desktop is negative, then current is assumed
*/
static const AppRule rules[] = { \
/* class desktop follow float */
{ "MPlayer", 2, True, False },
};
/* helper for spawning shell commands */
#define SHCMD(cmd) {.com = (const char*[]){"/bin/sh", "-c", cmd, NULL}}
/**
* custom commands
* must always end with ', NULL };'
*/
static const char *dmenucmd[] = { "dmenu_run", "-b", "-i", "-fn", "-*-ohsnap-medium-r-*-*-12-*-*-*-*-*-*-*", "-nb", "#222222", "-nf", "#bbbbbb","-sb", "#42717b", "-sf", "#bbbbbb", NULL };
static const char *termcmd[] = { "urxvt", NULL };
static const char *webcmd[] = { "firefox", NULL };
static const char *suspendcmd[] = { "dbus-send", "--system", "--print-reply", "--dest=org.freedesktop.UPower", "/org/freedesktop/UPower", "org.freedesktop.UPower.Suspend", NULL };
static const char *hibernatecmd[] = { "dbus-send", "--system", "--print-reply", "--dest=org.freedesktop.UPower", "/org/freedesktop/UPower", "org.freedesktop.UPower.Hibernate", NULL };
static const char *rebootcmd[] = { "dbus-send", "--system", "--print-reply", "--dest=org.freedesktop.ConsoleKit", "/org/freedesktop/ConsoleKit/Manager", "org.freedesktop.ConsoleKit.Manager.Restart", NULL };
static const char *shutdowncmd[] = { "dbus-send", "--system", "--print-reply", "--dest=org.freedesktop.ConsoleKit", "/org/freedesktop/ConsoleKit/Manager", "org.freedesktop.ConsoleKit.Manager.Stop", NULL };
#define DESKTOPCHANGE(K,N) \
{ MOD4, K, change_desktop, {.i = N}}, \
{ MOD4|ShiftMask, K, client_to_desktop, {.i = N}},
/**
* keyboard shortcuts
*/
static Key keys[] = {
/* modifier key function argument */
/* Basic commands */
{ MOD4|SHIFT, XK_b, togglepanel, {NULL}},
{ MOD4, XK_u, focusurgent, {NULL}},
{ MOD4, XK_c, killclient, {NULL}},
{ MOD4, XK_j, next_win, {NULL}},
{ MOD4, XK_k, prev_win, {NULL}},
{ MOD4, XK_h, resize_master, {.i = -10}}, /* decrease size in px */
{ MOD4, XK_l, resize_master, {.i = +10}}, /* increase size in px */
{ MOD4, XK_o, resize_stack, {.i = -10}}, /* shrink size in px */
{ MOD4, XK_p, resize_stack, {.i = +10}}, /* grow size in px */
{ MOD4|CONTROL, XK_h, rotate, {.i = -1}},
{ MOD4|CONTROL, XK_l, rotate, {.i = +1}},
{ MOD4|SHIFT, XK_h, rotate_filled, {.i = -1}},
{ MOD4|SHIFT, XK_l, rotate_filled, {.i = +1}},
{ MOD4, XK_Tab, last_desktop, {NULL}},
{ MOD4, XK_Return, swap_master, {NULL}},
{ MOD4|SHIFT, XK_j, move_down, {NULL}},
{ MOD4|SHIFT, XK_k, move_up, {NULL}},
{ MOD4|SHIFT, XK_t, switch_mode, {.i = TILE}},
{ MOD4, XK_m, switch_mode, {.i = MONOCLE}},
{ MOD4, XK_b, switch_mode, {.i = BSTACK}},
{ MOD4, XK_g, switch_mode, {.i = GRID}},
{ MOD4, XK_f, switch_mode, {.i = FLOAT}},
{ MOD4|CONTROL, XK_r, quit, {.i = 0}}, /* quit with exit value 0 */
{ MOD4|CONTROL, XK_q, quit, {.i = 1}}, /* quit with exit value 1 */
/* Other commands */
{ MOD4, XK_r, spawn, {.com = dmenucmd}},
{ MOD4, XK_w, spawn, {.com = webcmd}},
{ MOD4, XK_t, spawn, {.com = termcmd}},
{ MOD1|CONTROL, XK_s, spawn, {.com = suspendcmd}},
{ MOD1|CONTROL, XK_h, spawn, {.com = hibernatecmd}},
{ MOD1|CONTROL, XK_r, spawn, {.com = rebootcmd}},
{ MOD1|CONTROL, XK_q, spawn, {.com = shutdowncmd}},
/* Moves, resizes + changes layout*/
{ MOD1|SHIFT, XK_j, moveresize, {.v = (int []){ 0, 25, 0, 0 }}}, /* move up */
{ MOD1|SHIFT, XK_k, moveresize, {.v = (int []){ 0, -25, 0, 0 }}}, /* move down */
{ MOD1|SHIFT, XK_l, moveresize, {.v = (int []){ 25, 0, 0, 0 }}}, /* move right */
{ MOD1|SHIFT, XK_h, moveresize, {.v = (int []){ -25, 0, 0, 0 }}}, /* move left */
{ MOD1|CONTROL, XK_j, moveresize, {.v = (int []){ 0, 0, 0, 25 }}}, /* height grow */
{ MOD1|CONTROL, XK_k, moveresize, {.v = (int []){ 0, 0, 0, -25 }}}, /* height shrink */
{ MOD1|CONTROL, XK_l, moveresize, {.v = (int []){ 0, 0, 25, 0 }}}, /* width grow */
{ MOD1|CONTROL, XK_h, moveresize, {.v = (int []){ 0, 0, -25, 0 }}}, /* width shrink */
DESKTOPCHANGE( XK_1, 0)
DESKTOPCHANGE( XK_2, 1)
DESKTOPCHANGE( XK_3, 2)
DESKTOPCHANGE( XK_4, 3)
};
/**
* mouse shortcuts
*/
static Button buttons[] = {
{ MOD4, Button1, mousemotion, {.i = MOVE}},
{ MOD4, Button3, mousemotion, {.i = RESIZE}},
};
#endif