JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fix keys pressed while kbspawn key is still down
[dwm.git] / config.def.h
1 /* See LICENSE file for copyright and license details. */
2
3 /* appearance */
4 static const char font[]            = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";
5 static const char normbordercolor[] = "#444444";
6 static const char normbgcolor[]     = "#222222";
7 static const char normfgcolor[]     = "#bbbbbb";
8 static const char selbordercolor[]  = "#005577";
9 static const char selbgcolor[]      = "#005577";
10 static const char selfgcolor[]      = "#eeeeee";
11 static const unsigned int borderpx  = 0;        /* border pixel of windows */
12 static const unsigned int snap      = 32;       /* snap pixel */
13 static const Bool showbar           = True;     /* False means no bar */
14 static const Bool topbar            = True;     /* False means bottom bar */
15
16 /* tagging */
17 static const char *tags[] = { "`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "[", "]" };
18 static const char *workspace_numbers_str[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" };
19
20 #define TBC(tag, wclass) { wclass, NULL, NULL, 1 << tag, False, False, -1 },
21 #define TBT(tag, title) { NULL, NULL, title, 1 << tag, False, False, -1 },
22 #define SHBC(tag, wclass) { wclass, NULL, NULL, 1 << tag, False, True, -1 },
23 static const Rule rules[] = {
24         /* xprop(1):
25          *      WM_CLASS(STRING) = instance, class
26          *      WM_NAME(STRING) = title
27          */
28         // Tag By Class
29         TBC( 1, "Chromium")
30         //TBC( 7, "Firefox")
31         TBC( 7, "Iceweasel")
32         TBC( 9, "Transmission-gtk")
33         TBC(10, "Pidgin")
34         // Screen Hog (By class) + tag
35         SHBC( 2, "Inkscape")
36         SHBC( 2, "org-openstreetmap-josm-Main") // Josm (both splash and main window)
37         SHBC( 3, "VirtualBox")
38         SHBC( 5, "Gimp")
39         // Tag By Title (matches prefix)
40         TBT( 1, "w1: ")
41         TBT( 2, "w2: ")
42         TBT( 3, "w3: ")
43         TBT( 4, "w4: ")
44         TBT( 5, "w5: ")
45         TBT( 6, "w6: ")
46         TBT( 7, "w7: ")
47         TBT( 8, "w8: ")
48         TBT( 9, "w9: ")
49         TBT(10, "w10: ")
50         TBT(11, "w11: ")
51         TBT(12, "w12: ")
52         // make run dialog floating
53         { NULL, "zsh_run", NULL, 0, True, False, -1 },
54 };
55
56 /* layout(s) */
57 static const float mfact      = 0.595; /* factor of master area size [0.05..0.95] */
58 static const int nmaster      = 1;    /* number of clients in master area */
59 static const Bool resizehints = False; /* True means respect size hints in tiled resizals */
60
61 static const Layout layouts[] = {
62         /* symbol     arrange function */
63         { "   ",      jason_layout },
64         { "Flo",      NULL },    // floating (don't think this gets used ever)
65         { "   ",      monocle }, // symbol is ignored
66 };
67
68 /* key definitions */
69 #define MODKEY Mod4Mask
70 #define TAGKEYS(KEY,TAG) \
71         { MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
72         { MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
73         { MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
74         { MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} }
75
76 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
77 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
78
79 /* commands */
80 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
81 //static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
82 static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
83 char WORKSPACE_NUMBER[] = "WORKSPACE_NUMBER=00";
84 static const char *termcmd[]  = { "env", (const char *)(&(WORKSPACE_NUMBER[0])), "st", NULL };
85
86 #define ARGS(...) {.v = (const char *[]) {__VA_ARGS__, NULL}}
87
88 static Key keys[] = {
89         /* modifier           key                      function        argument */
90         {0,                   XK_Scroll_Lock,          spawn,          ARGS("pulseaudio-set-sink", "toggle")},
91         {ControlMask,         XK_Scroll_Lock,          spawn,          ARGS("pulseaudio-set-sink", "headphones")},
92         {ShiftMask,           XK_Scroll_Lock,          spawn,          ARGS("pulseaudio-set-sink", "speakers")},
93         {0,                   XK_Pause,                spawn,          ARGS("black", "0.2")},
94         {0,                   XK_F3,                   spawn,          ARGS("vol", "down")},
95         {0,                   XF86XK_AudioLowerVolume, spawn,          ARGS("vol", "down")},
96         {0,                   XK_F4,                   spawn,          ARGS("vol", "up")},
97         {0,                   XF86XK_AudioRaiseVolume, spawn,          ARGS("vol", "up")},
98         {0,                   XF86XK_AudioPrev,        spawn,          ARGS("sayremote", "back")},
99         {0,                   XK_F5,                   spawn,          ARGS("sayremote", "back")},
100         {MODKEY,              XK_F5,                   spawn,          ARGS("sayremote", "slower")},
101         {0,                   XF86XK_AudioNext,        spawn,          ARGS("sayremote", "forward")},
102         {0,                   XK_F6,                   spawn,          ARGS("sayremote", "forward")},
103         {MODKEY,              XK_F6,                   spawn,          ARGS("sayremote", "faster")},
104         {0,                   XK_F7,                   spawn,          ARGS("sayremote", "pause")},
105         {0,                   XF86XK_AudioPause,       spawn,          ARGS("sayremote", "pause")},
106         {0,                   XF86XK_AudioStop,        spawn,          ARGS("sayremote", "stop")},
107         {0,                   XK_F8,                   spawn,          ARGS("sayremote", "stop")},
108         {MODKEY,              XK_F8,                   spawn,          ARGS("sayremote", "reset")},
109         {0,                   XK_F10,                  spawn,          ARGS("sayclip")},
110         {ControlMask,         XK_Return,               spawn,          ARGS("default-browser-clipboard")},
111         {MODKEY,              XK_Return,               spawn,          ARGS("default-browser-debian-bug")},
112         {0,                   XK_F1,                   kbspawn,        ARGS("run-dialog")},
113         {MODKEY,              XK_l,                    view,           {.ui = 1 << 1}},
114         {MODKEY,              XK_l,                    focusstack,     {.i = 0}},
115         {MODKEY,              XK_l,                    kbspawn,        ARGS("url-dialog")},
116         {0,                   XK_F2,                   kbspawn,        {.v = termcmd}},
117         {MODKEY,              XK_b,                    togglebar,      {0}},
118         {MODKEY,              XK_n,                    focusstack,     {.i = +1}},
119         {MODKEY,              XK_h,                    focusstack,     {.i = 0}},
120         {MODKEY,              XK_c,                    focusstack,     {.i = -1}},
121 //      {MODKEY,              XK_i,                    incnmaster,     {.i = +1}},
122 //      {MODKEY,              XK_d,                    incnmaster,     {.i = -1}},
123         {MODKEY|ControlMask,  XK_h,                    setmfact,       {.f = -0.05}},
124         {MODKEY|ControlMask,  XK_n,                    setmfact,       {.f = +0.05}},
125         {MODKEY|ShiftMask,    XK_h,                    zoom,           {0}},
126         {MODKEY,              XK_Tab,                  view,           {0}},
127         {MODKEY,              XK_w,                    killclient,     {0}},
128         {MODKEY|ShiftMask,    XK_f,                    setlayout,      {.v = &layouts[0]}},
129         {MODKEY,              XK_f,                    setlayout,      {.v = &layouts[2]}},
130 //      {MODKEY,              XK_space,                setlayout,      {0}},
131         {MODKEY|ShiftMask,    XK_space,                togglefloating, {0}},
132 //      {MODKEY,              XK_0,                    view,           {.ui = ~0}},
133 //      {MODKEY|ShiftMask,    XK_0,                    tag,            {.ui = ~0}},
134 //      {MODKEY,              XK_comma,                focusmon,       {.i = -1}},
135 //      {MODKEY,              XK_period,               focusmon,       {.i = +1}},
136 //      {MODKEY|ShiftMask,    XK_comma,                tagmon,         {.i = -1}},
137 //      {MODKEY|ShiftMask,    XK_period,               tagmon,         {.i = +1}},
138         {MODKEY|ShiftMask,    XK_q,                    quit,           {0}},
139         TAGKEYS(              XK_grave,        0),
140         TAGKEYS(              XK_1,            1),
141         TAGKEYS(              XK_2,            2),
142         TAGKEYS(              XK_3,            3),
143         TAGKEYS(              XK_4,            4),
144         TAGKEYS(              XK_5,            5),
145         TAGKEYS(              XK_6,            6),
146         TAGKEYS(              XK_7,            7),
147         TAGKEYS(              XK_8,            8),
148         TAGKEYS(              XK_9,            9),
149         TAGKEYS(              XK_0,            10),
150         TAGKEYS(              XK_bracketleft,  11),
151         TAGKEYS(              XK_bracketright, 12),
152 };
153
154 // X.h defines Button1 through Button5
155 #ifndef Button8
156         #define Button8 (Button1 + 7)
157 #endif
158
159 /* button definitions */
160 /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
161 static Button buttons[] = {
162         /* click               event mask      button          function        argument */
163         {ClkAnywhere,          0,              Button8,        spawn,          ARGS("sayclip", "--no-terminal")},
164         {ClkClientWin,         MODKEY,         Button1,        movemouse,      {0}},
165         {ClkClientWin,         MODKEY,         Button2,        togglefloating, {0}},
166         {ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0}},
167 };
168