dwm-keymodes-vim-config.h - sites - public wiki contents of suckless.org
(HTM) git clone git://git.suckless.org/sites
(DIR) Log
(DIR) Files
(DIR) Refs
---
dwm-keymodes-vim-config.h (11712B)
---
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[] = "#1f1f1f";
6 static const char normbgcolor[] = "#1f1f1f";
7 static const char normfgcolor[] = "#c0c0c0";
8 static const char selbordercolor[] = "#ff8000";
9 static const char selbgcolor[] = "#1f1f1f";
10 static const char selfgcolor[] = "#ff8000";
11 static const unsigned int borderpx = 1; /* 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" };
18
19 /* include(s) depending on the tags array */
20 #include "flextile.h"
21
22 /* include(s) defining functions */
23 #include "keymodes.pre.h"
24
25 static const Rule rules[] = {
26 /* class instance title tags mask isfloating monitor */
27 { "Gimp", NULL, NULL, 0, True, -1 },
28 { "Firefox", NULL, NULL, 1 << 4, False, -1 },
29 };
30
31 /* layout(s) */
32 static const float mfact = 0.6; /* factor of master area size [0.05..0.95] */
33 static const Bool resizehints = True; /* True means respect size hints in tiled resizals */
34 static const int layoutaxis[] = {
35 1, /* layout axis: 1 = x, 2 = y; negative values mirror the layout, setting the master area to the right / bottom instead of left / top */
36 2, /* master axis: 1 = x (from left to right), 2 = y (from top to bottom), 3 = z (monocle) */
37 2, /* stack axis: 1 = x (from left to right), 2 = y (from top to bottom), 3 = z (monocle) */
38 };
39
40 static const Layout layouts[] = {
41 /* symbol arrange function */
42 { "[M]", monocle }, /* first entry is default */
43 { "[]=", tile },
44 { "><>", NULL }, /* no layout function means floating behavior */
45 };
46
47 /* key definitions */
48 #define MODKEY Mod1Mask
49 #define TAGKEYS(KEY,TAG) \
50 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
51 { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
52 { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
53 { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
54
55 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
56 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
57
58 /* commands */
59 static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
60 static const char *haltcmd[] = { "sudo", "halt", NULL };
61 static const char *helpcmd[] = { "uxterm", "-e", "man", "dwm", NULL };
62 static const char *sleepcmd[] = { "sudo", "pm-suspend", NULL };
63 static const char *termcmd[] = { "uxterm", NULL };
64 static const char *audio1cmd[] = { "amixer", "--quiet", "sset", "Master", "1+", NULL };
65 static const char *audio2cmd[] = { "amixer", "--quiet", "sset", "Master", "1-", NULL };
66 static const char *audio3cmd[] = { "amixer", "--quiet", "sset", "Master", "toggle", NULL };
67
68 #include <X11/XF86keysym.h>
69 static Key keys[] = {
70 /* modifier key function argument */
71 { 0, XK_Super_L, setkeymode, {.ui = COMMANDMODE} },
72 { 0, XF86XK_AudioRaiseVolume, spawn, {.v = audio1cmd} },
73 { 0, XF86XK_AudioLowerVolume, spawn, {.v = audio2cmd} },
74 { MODKEY|ShiftMask, XK_m, spawn, {.v = audio3cmd} },
75 { MODKEY, XK_Down, focusstack, {.i = +1 } },
76 { MODKEY, XK_Up, focusstack, {.i = -1 } },
77 { MODKEY, XK_Tab, view, {0} },
78 { MODKEY, XK_f, setlayout, {.v = &layouts[2]} },
79 { MODKEY, XK_space, setlayout, {0} },
80 { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
81 { MODKEY, XK_0, view, {.ui = ~0 } },
82 { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
83 { MODKEY, XK_comma, focusmon, {.i = -1 } },
84 { MODKEY, XK_period, focusmon, {.i = +1 } },
85 { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
86 { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
87 TAGKEYS( XK_1, 0)
88 TAGKEYS( XK_2, 1)
89 TAGKEYS( XK_3, 2)
90 TAGKEYS( XK_4, 3)
91 TAGKEYS( XK_5, 4)
92 };
93
94 static const int h_master[] = {+1, 2, 2};
95 static const int j_master[] = {-2, 1, 1};
96 static const int k_master[] = {+2, 1, 1};
97 static const int l_master[] = {-1, 2, 2};
98
99 static Key cmdkeys[] = {
100 /* modifier keys function argument */
101 { 0, XK_Escape, clearcmd, {0} },
102 { ControlMask, XK_c, clearcmd, {0} },
103 { 0, XK_i, setkeymode, {.ui = INSERTMODE} },
104 { 0, XF86XK_Standby, spawn, {.v = sleepcmd} },
105 };
106 static Command commands[] = {
107 /* modifier (4 keys) keysyms (4 keys) function argument */
108 { {0, 0, 0, 0}, {XK_g, XK_t, 0, 0}, adjacentview, {.i = +1} },
109 { {0, ShiftMask, 0, 0}, {XK_g, XK_t, 0, 0}, adjacentview, {.i = -1} },
110 { {ControlMask, 0, 0, 0}, {XK_w, XK_c, 0, 0}, closewindow, {0} },
111 { {ControlMask, 0, 0, 0}, {XK_w, XK_h, 0, 0}, focustiled, {.i = -1} },
112 { {ControlMask, 0, 0, 0}, {XK_w, XK_j, 0, 0}, focustiled, {.i = +2} },
113 { {ControlMask, 0, 0, 0}, {XK_w, XK_k, 0, 0}, focustiled, {.i = -2} },
114 { {ControlMask, 0, 0, 0}, {XK_w, XK_l, 0, 0}, focustiled, {.i = +1} },
115 { {ControlMask, ShiftMask, 0, 0}, {XK_w, XK_h, 0, 0}, setmaster, {.v = h_master} },
116 { {ControlMask, ShiftMask, 0, 0}, {XK_w, XK_j, 0, 0}, setmaster, {.v = j_master} },
117 { {ControlMask, ShiftMask, 0, 0}, {XK_w, XK_k, 0, 0}, setmaster, {.v = k_master} },
118 { {ControlMask, ShiftMask, 0, 0}, {XK_w, XK_l, 0, 0}, setmaster, {.v = l_master} },
119 { {ControlMask, 0, 0, 0}, {XK_w, XK_o, 0, 0}, setlayout, {.v = &layouts[0]} },
120 { {ControlMask, ShiftMask, 0, 0}, {XK_w, XK_o, 0, 0}, onlyclient, {0} },
121 { {ControlMask, 0, 0, 0}, {XK_w, XK_s, 0, 0}, split, {.ui = 2} },
122 { {ControlMask, 0, 0, 0}, {XK_w, XK_t, 0, 0}, adjacenttag, {.i = +1} },
123 { {ControlMask, ShiftMask, 0, 0}, {XK_w, XK_t, 0, 0}, adjacenttag, {.i = -1} },
124 { {ControlMask, 0, 0, 0}, {XK_w, XK_v, 0, 0}, split, {.ui = 1} },
125 { {ControlMask, 0, 0, 0}, {XK_w, XK_x, 0, 0}, exchangewindow, {.i = +1} },
126 { {ControlMask, ShiftMask, 0, 0}, {XK_w, XK_x, 0, 0}, exchangewindow, {.i = -1} },
127 { {ControlMask, 0, 0, 0}, {XK_w, XK_w, 0, 0}, focuswindow, {.i = +1} },
128 { {ControlMask, ShiftMask, 0, 0}, {XK_w, XK_w, 0, 0}, focuswindow, {.i = -1} },
129 { {ControlMask, ShiftMask, 0, 0}, {XK_w, XK_0, 0, 0}, setmfact, {.f = +1.50} },
130 { {ControlMask, 0, 0, 0}, {XK_w, XK_less, 0, 0}, resizemaster, {.f = -10.05} },
131 { {ControlMask, ShiftMask, 0, 0}, {XK_w, XK_less, 0, 0}, resizemaster, {.f = +10.05} },
132 { {ControlMask, 0, 0, 0}, {XK_w, XK_minus, 0, 0}, resizemaster, {.f = -20.05} },
133 { {ControlMask, 0, 0, 0}, {XK_w, XK_plus, 0, 0}, resizemaster, {.f = +20.05} },
134 { {ShiftMask, 0, 0, 0}, {XK_period, XK_e, 0, 0}, spawn, {.v = dmenucmd} },
135 { {ShiftMask, 0, 0, 0}, {XK_period, XK_o, 0, 0}, spawn, {.v = dmenucmd} },
136 { {ShiftMask, ShiftMask, 0, 0}, {XK_period, XK_1, 0, 0}, spawn, {.v = termcmd} },
137 { {ControlMask, 0, ShiftMask, 0}, {XK_w, XK_1, XK_t, 0}, tag, {.ui = 1 << 0} },
138 { {ControlMask, 0, ShiftMask, 0}, {XK_w, XK_2, XK_t, 0}, tag, {.ui = 1 << 1} },
139 { {ControlMask, 0, ShiftMask, 0}, {XK_w, XK_3, XK_t, 0}, tag, {.ui = 1 << 2} },
140 { {ControlMask, 0, ShiftMask, 0}, {XK_w, XK_4, XK_t, 0}, tag, {.ui = 1 << 3} },
141 { {ControlMask, 0, ShiftMask, 0}, {XK_w, XK_5, XK_t, 0}, tag, {.ui = 1 << 4} },
142 { {0, 0, 0, 0}, {XK_1, XK_g, XK_t, 0}, view, {.ui = 1 << 0} },
143 { {0, 0, 0, 0}, {XK_2, XK_g, XK_t, 0}, view, {.ui = 1 << 1} },
144 { {0, 0, 0, 0}, {XK_3, XK_g, XK_t, 0}, view, {.ui = 1 << 2} },
145 { {0, 0, 0, 0}, {XK_4, XK_g, XK_t, 0}, view, {.ui = 1 << 3} },
146 { {0, 0, 0, 0}, {XK_5, XK_g, XK_t, 0}, view, {.ui = 1 << 4} },
147 { {ShiftMask, 0, 0, 0}, {XK_period, XK_h, XK_Return, 0}, spawn, {.v = helpcmd} },
148 { {ShiftMask, 0, 0, 0}, {XK_period, XK_q, XK_Return, 0}, quit, {0} },
149 { {ShiftMask, 0, 0, 0}, {XK_period, XK_b, XK_d, XK_Return}, killclient, {0} },
150 { {ShiftMask, 0, 0, 0}, {XK_period, XK_b, XK_n, XK_Return}, focusstack, {.i = +1} },
151 { {ShiftMask, 0, ShiftMask, 0}, {XK_period, XK_b, XK_n, XK_Return}, focusstack, {.i = -1} },
152 { {ShiftMask, 0, ShiftMask, 0}, {XK_period, XK_q, XK_1, XK_Return}, spawn, {.v = haltcmd} },
153 { {ShiftMask, 0, 0, 0}, {XK_period, XK_g, XK_o, XK_Return}, togglebar, {0} },
154 };
155
156 /* button definitions */
157 /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
158 static Button buttons[] = {
159 /* click event mask button function argument */
160 };
161
162 /* include(s) depending on the configuration variables */
163 #include "keymodes.post.h"