aboutsummaryrefslogtreecommitdiff
path: root/config.h
blob: 5baa70accc68e85a8616e39f1c27fdf5a121a8e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/* 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       False     /* False means panel is on bottom */
#define PANEL_HEIGHT    18        /* 0 for no space for panel, thus no panel */
#define DEFAULT_MODE    RTILE     /* initial layout/mode: TILE MONOCLE BSTACK RTILE 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    Button3   /* mouse button to be used along with CLICK_TO_FOCUS */
#define BORDER_WIDTH    1         /* window border width */
#define GAP_WIDTH       6         /* pointless gap */
#define FOCUS           "#ff950e" /* 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        8         /* 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  ignore*/
    { "stalonetray", -1,   True,   True, True },
};

/* 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 *termcmd[]     = { "alacritty",     NULL };
static const char *menucmd[]     = { "run",           NULL };
static const char *now_playing[] = { "now_playing",   NULL };
static const char *albumbler[]   = { "albumbler.py",  NULL };
static const char *mpc_toggle[]  = { "mpc", "toggle", NULL };
static const char *mpc_next[]    = { "mpc", "next",   NULL };
static const char *mpc_prev[]    = { "mpc", "prev",   NULL };
static const char *mpc_stop[]    = { "mpc", "stop",   NULL };
static const char *lock[]        = { "lock",          NULL };

#define XF86AudioLowerVolume 0x1008ff11
#define XF86AudioMute        0x1008ff12
#define XF86AudioRaiseVolume 0x1008ff13
#define XF86AudioPlay        0x1008ff14
#define XF86AudioStop        0x1008ff15
#define XF86AudioPrev        0x1008ff16
#define XF86AudioNext        0x1008ff17

static const char *vol_dn[] = { "pactl", "set-sink-volume", "0", "-1%",    NULL };
static const char *vol_up[] = { "pactl", "set-sink-volume", "0", "+1%",    NULL };
static const char *vol_mt[] = { "pactl", "set-sink-mute",   "0", "toggle", 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 */

    // Commands
    { MOD4,               XK_t,          spawn,             {.com = termcmd} },
    { MOD4,               XK_d,          spawn,             {.com = menucmd} },
    { MOD4|SHIFT,         XK_space,      spawn,             {.com = albumbler } },
    { MOD4|SHIFT|CONTROL, XK_space,      spawn,             {.com = now_playing } },
    { MOD4,               XK_x,          spawn,             {.com = lock } },
    { MOD4|SHIFT|CONTROL, XK_q,          quit,              {.i = 0} }, /* quit with exit value 0 */

    // Multimedia
    { 0,                  XF86AudioLowerVolume, spawn,      {.com = vol_dn } },
    { 0,                  XF86AudioMute,        spawn,      {.com = vol_mt } },
    { 0,                  XF86AudioRaiseVolume, spawn,      {.com = vol_up } },
    { 0,                  XF86AudioPlay,        spawn,      {.com = mpc_toggle } },
    { 0,                  XF86AudioStop,        spawn,      {.com = mpc_stop } },
    { 0,                  XF86AudioPrev,        spawn,      {.com = mpc_prev } },
    { 0,                  XF86AudioNext,        spawn,      {.com = mpc_next } },

    // Windows
    { MOD4,               XK_c,          next_win,          {NULL} },
    { MOD4,               XK_i,          prev_win,          {NULL} },
    { MOD4|SHIFT,         XK_c,          move_down,         {NULL} },
    { MOD4|SHIFT,         XK_i,          move_up,           {NULL} },
    { MOD4|SHIFT,         XK_k,          killclient,        {NULL} },
    { MOD4,               XK_Return,     swap_master,       {NULL} },
    { MOD4,               XK_BackSpace,  focusurgent,       {NULL} },
    { MOD4,               XK_e,          resize_master,     {.i = +10} }, /* increase size in px */
    { MOD4,               XK_n,          resize_master,     {.i = -10} }, /* decrease size in px */
    { MOD4|SHIFT,         XK_e,          resize_stack,      {.i = +10} }, /* increase size in px */
    { MOD4|SHIFT,         XK_n,          resize_stack,      {.i = -10} }, /* decrease size in px */

    // Desktops
    { MOD4,               XK_Tab,        last_desktop,      {NULL} },
    DESKTOPCHANGE(        XK_f,                             0)
    DESKTOPCHANGE(        XK_u,                             1)
    DESKTOPCHANGE(        XK_h,                             2)
    DESKTOPCHANGE(        XK_period,                        3)
    DESKTOPCHANGE(        XK_v,                             4)
    DESKTOPCHANGE(        XK_l,                             5)
    DESKTOPCHANGE(        XK_o,                             6)
    DESKTOPCHANGE(        XK_m,                             7)

    // Layouts
    { MOD4,               XK_s,          switch_mode,       {.i = RTILE} },
    { MOD4,               XK_r,          switch_mode,       {.i = MONOCLE} },
    { MOD4,               XK_a,          switch_mode,       {.i = BSTACK} },
    { MOD4|SHIFT,         XK_s,          switch_mode,       {.i = TILE} },
    { MOD4|SHIFT,         XK_r,          switch_mode,       {.i = FLOAT} },
    { MOD4,               XK_b,          togglepanel,       {NULL} },
};

/**
 * mouse shortcuts
 */
static Button buttons[] = {
    { MOD4,    Button1,     mousemotion,   {.i = MOVE} },
    { MOD4,    Button3,     mousemotion,   {.i = RESIZE} },
};
#endif

/* vim: set expandtab ts=4 sts=4 sw=4 : */