Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: e1db3b081f
Fetching contributors…

Cannot retrieve contributors at this time

128 lines (114 sloc) 6.678 kb
/* config.h for snapwm.c [ 0.5.7 ]
*
* Started from catwm 31/12/10
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* RC FILE set to $HOME/.config/snapwm/rc.conf
*/
#ifndef CONFIG_H
#define CONFIG_H
#define STATUS_BAR 0 /* 1=Don't 0=Make the bar */
#define FONTS_ERROR 1 /* 1=Don't 0=Print errors about missing fonts */
/* Mod (Mod1 == alt) (Mod4 == Super/windows) */
#define MOD1 Mod1Mask
#define MOD4 Mod4Mask
#define DESKTOPS 6 /* Must edit DESKTOPCHANGE keys to suit */
#define LA_WINDOWNAME 1 /* 1=Dont't 0=Left align current window name in bar */
// The settings from here to defaultfont[] are in the rc file, which has precedence,
// so if the rc file all has these 15 options they don't have to be changed.
#define UF_ALPHA 75 /* Percentage transparency for unfocused windows - 100 to turn off */
#define MASTER_SIZE 55
#define BORDER_WIDTH 2
#define RESIZEMOVEKEY MOD1
#define ATTACH_ASIDE 1 /* 1=Don't 0=Place new window in the stack */
#define TOP_STACK 0 /* 1=Don't 0=Place new window at the top of the stack when using ATTACH_ASIDE*/
#define DEFAULT_MODE 4 /* 0=Vertical, 1=Fullscreen 2=Horizontal 3=Grid 4=Stacking*/
#define FOLLOW_MOUSE 0 /* 1=Don't 0=Focus the window the mouse just entered */
#define CLICK_TO_FOCUS 1 /* 1=Don't 0=Focus an unfocused window when clicked */
#define TOP_BAR 0 /* 1=Don't 0=Have the bar at the top instead of the bottom */
#define SHOW_BAR 0 /* 1=Don't 0=Have the bar shown at startup */
#define SHOW_NUM_OPEN 1 /* 1=Dont' 0=Show the number of open windows in the switcher */
#define WINDOW_NAME_LENGTH 35 /* Character length for the current window's name in the bar */
static const char *defaultdesktopnames[] = { "1", "2", "3", "4", "5", "6", };
static const char *defaultbarcolor[] = { "#ff0000", "#00ff00", "#0000ff", "#000000", };
static const char *defaulttextcolor[] = { "#000000", "#ffffff", "#ffffff", "#ffff00", "#ff00ff", "#f0f0f0", "#0f0f0f", };
static const char *defaultwincolor[] = { "#ff0000", "#00ff00", };
static const char *defaultmodename[] = { "[0]", "[1]", "[2]", "[3]", "[4]", };
static const char defaultfontlist[] = "-*-terminus-medium-r-*-*-12-*-*-*-*-*-*-*";
// Open applications on a specific desktop. Examples given are commented out
static const Convenience convenience[] = { \
/* class desktop follow 1=Don't 0=Change the desktop*/
{ "None", 0, 0 },
//{ "Firefox", 3, 0 },
//{ "MPlayer", 4, 0 },
};
// In stacking mode set position and size for application
static const Positional positional[] = { \
/* class x y width height */
{ "None", 0, 0, 0, 0 },
//{ "URxvt", 100,320,820,400 },
};
// Using a script makes changing commands easy
const char* dmenucmd[] = {"dmenu_run","-i","-nb","#666622","-nf","white",NULL};
const char* terminalcmd[] = {"xterm",NULL};
// Avoid multiple paste
#define DESKTOPCHANGE(K,N) \
{ MOD1, K, change_desktop, {.i = N}}, \
{ MOD1|ShiftMask, K, follow_client_to_desktop, {.i = N}}, \
{ MOD4|ShiftMask, K, client_to_desktop, {.i = N}},
// Shortcuts
static key keys[] = {
// MOD KEY FUNCTION ARGS
{ MOD1, XK_h, resize_master, {.i = 10}},
{ MOD1, XK_l, resize_master, {.i = -10}},
{ MOD1, XK_c, kill_client, {NULL}},
{ MOD1, XK_j, next_win, {NULL}},
{ MOD1, XK_k, prev_win, {NULL}},
{ MOD1, XK_v, spawn, {.com = dmenucmd}},
{ MOD1, XK_p, resize_stack, {.i = 10}},
{ MOD1, XK_o, resize_stack, {.i = -10}},
{ MOD1, XK_u, update_config, {NULL}},
{ MOD1, XK_Tab, last_desktop, {NULL}},
{ MOD1, XK_a, rotate_mode, {.i = 1}},
// alt + shift + shortcut
{ MOD1|ShiftMask, XK_j, move_up, {.i = -10}},
{ MOD1|ShiftMask, XK_k, move_down, {.i = 10}},
{ MOD1|ShiftMask, XK_o, move_left, {.i = -10}},
{ MOD1|ShiftMask, XK_p, move_right, {.i = 10}},
{ MOD1|ShiftMask, XK_Return, swap_master, {NULL}},
{ MOD1|ShiftMask, XK_g, switch_mode, {.i = 3}}, // grid
{ MOD1|ShiftMask, XK_h, switch_mode, {.i = 2}}, // horizontal
{ MOD1|ShiftMask, XK_f, switch_mode, {.i = 1}}, // fullscreen
{ MOD1|ShiftMask, XK_v, switch_mode, {.i = 0}}, // vertical
{ MOD1|ShiftMask, XK_c, switch_mode, {.i = 4}}, // stacking
// Control + alt + shortcut
{ MOD1|ControlMask, XK_q, quit, {NULL}},
// Window key + shortcut
{ MOD4, XK_Right, rotate_desktop, {.i = 1}},
{ MOD4, XK_Left, rotate_desktop, {.i = -1}},
{ MOD4, XK_b, toggle_bar, {NULL}},
{ MOD4, XK_t, spawn, {.com = terminalcmd}},
DESKTOPCHANGE( XK_1, 0)
DESKTOPCHANGE( XK_2, 1)
DESKTOPCHANGE( XK_3, 2)
DESKTOPCHANGE( XK_4, 3)
DESKTOPCHANGE( XK_5, 4)
DESKTOPCHANGE( XK_6, 5)
};
#endif
Jump to Line
Something went wrong with that request. Please try again.