config.h (10366B)
1 /* See LICENSE file for copyright and license details. */ 2 3 /* Enable multimedia keys */ 4 #include <X11/XF86keysym.h> 5 6 /* appearance */ 7 static const unsigned int borderpx = 3; /* border pixel of windows */ 8 static const unsigned int snap = 32; /* snap pixel */ 9 static const int showtitle = 0; /* 0 means no title */ 10 static const int showbar = 1; /* 0 means no bar */ 11 static const int topbar = 1; /* 0 means bottom bar */ 12 static const char *fonts[] = { "Sans:size=11" }; 13 static const char dmenufont[] = "Sans:size=12"; 14 static const char dmenuln[] = "20"; 15 /* Default colors 16 static const char col_gray1[] = "#222222"; 17 static const char col_gray2[] = "#444444"; 18 static const char col_gray3[] = "#bbbbbb"; 19 static const char col_gray4[] = "#eeeeee"; 20 static const char col_cyan[] = "#005577"; 21 */ 22 /* Nord colors */ 23 static const char col_gray1[] = "#2e3440"; /* nord0 */ 24 static const char col_gray3[] = "#eceff4"; /* nord6 */ 25 static const char col_gray4[] = "#e5e9f0"; /* nord5 */ 26 static const char col_cyan[] = "#5e81ac"; /* nord10 */ 27 static const char col_gray2[] = "#81a1c1"; /* nord9 */ 28 static const char col_red[] = "#bf616a"; /* nord11 */ 29 static const char col_yellow[] = "#ebcb8b"; /* nord13 */ 30 static const char *colors[][3] = { 31 /* fg bg border */ 32 [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, 33 [SchemeSel] = { col_gray4, col_cyan, col_yellow }, 34 }; 35 36 /* tagging */ 37 static const char *tags[] = { "", "", "", "", "", "", "⏯", "", "🌍" }; 38 39 static const Rule rules[] = { 40 /* xprop(1): 41 * WM_CLASS(STRING) = instance, class 42 * WM_NAME(STRING) = title 43 */ 44 /* class instance title tags mask isfloating monitor */ 45 { "Gimp", NULL, NULL, 0, 1, -1 }, 46 { NULL, NULL, "wifi", 0, 1, -1 }, 47 { "MEGAsync", NULL, NULL, 1, 1, -1 }, 48 { "de-unistuttgart-ims-coref-annotator-Annotator", NULL, NULL, 1<<2, 1, -1 }, 49 { "Geany", NULL, NULL, 1<<2, 0, -1 }, 50 { "RStudio", NULL, NULL, 1<<2, 0, -1 }, 51 { "Eclipse", NULL, NULL, 1<<2, 0, -1 }, 52 { NULL, NULL, "top", 1<<4, 0, -1 }, 53 { "Skype", NULL, NULL, 1<<5, 0, -1 }, 54 { NULL, "mpv-youtube", NULL, 1<<6, 0, -1 }, 55 { NULL, NULL, "mpv-youtube.bash", 1<<6, 0, -1 }, 56 { NULL, NULL, "youtube-viewer", 1<<6, 0, -1 }, 57 { NULL, NULL, "mpsyt", 1<<6, 0, -1 }, 58 { "Thunderbird", NULL, NULL, 1<<7, 0, -1 }, 59 { NULL, NULL, "mutt", 1<<7, 0, -1 }, 60 { "Firefox", NULL, NULL, 1<<8, 0, -1 }, 61 { "Nightly", NULL, NULL, 1<<8, 0, -1 }, 62 { "qutebrowser", NULL, NULL, 1<<8, 0, -1 }, 63 { NULL, "surf", NULL, 1<<8, 0, -1 }, 64 }; 65 66 /* layout(s) */ 67 static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ 68 static const int nmaster = 1; /* number of clients in master area */ 69 static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ 70 71 static const Layout layouts[] = { 72 /* symbol arrange function */ 73 { "[]=", tile }, /* first entry is default */ 74 { "[M]", monocle }, 75 { "><>", NULL }, /* no layout function means floating behavior */ 76 }; 77 78 /* key definitions */ 79 #define MODKEY Mod4Mask 80 #define TAGKEYS(KEY,TAG) \ 81 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 82 { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ 83 { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ 84 { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, 85 86 /* helper for spawning shell commands in the pre dwm-5.0 fashion */ 87 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } 88 89 /* commands */ 90 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ 91 static const char *dmenucmd[] = { "dmenu_run", "-c", "-p", "Run:", "-l", dmenuln, "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; 92 static const char *termcmd[] = { "st", NULL }; 93 static const char scratchpadname[] = "scratchpad"; 94 static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34", "-e", "/bin/tmux", "new", "-s", "scratchpad", NULL }; 95 static const char *statusbarcmd[] = { "statusbar", NULL }; /* Define command for starting dmenu-based statusbar */ 96 static const char *lockcmd[] = { "slock", NULL }; /* Define command for locking screen */ 97 static const char *volumeupcmd[] = { "pactl", "set-sink-volume", "0", "+1%", NULL }; 98 static const char *volumedowncmd[] = { "pactl", "set-sink-volume", "0", "-1%", NULL }; 99 static const char *volumemutecmd[] = { "amixer", "-q", "-D", "pulse", "sset", "Master", "toggle", NULL }; 100 static const char *audiotogglecmd[] = { "mpc", "toggle", NULL }; 101 static const char *brightnessupcmd[] = { "xbacklight", "-inc", "10", NULL }; 102 static const char *brightnessdowncmd[] = { "xbacklight", "-dec", "10", NULL }; 103 104 static Key keys[] = { 105 /* modifier key function argument */ 106 { MODKEY, XK_d, spawn, {.v = dmenucmd } }, 107 { MODKEY, XK_Return, spawn, {.v = termcmd } }, 108 { Mod1Mask, XK_s, togglescratch, {.v = scratchpadcmd } }, 109 { MODKEY, XK_x, togglebar, {0} }, 110 { MODKEY, XK_b, spawn, {.v = statusbarcmd } }, 111 { 0, XF86XK_AudioRaiseVolume, spawn, {.v = volumeupcmd } }, 112 { 0, XF86XK_AudioLowerVolume, spawn, {.v = volumedowncmd } }, 113 { 0, XF86XK_AudioMute, spawn, {.v = volumemutecmd } }, 114 { 0, XF86XK_AudioPlay, spawn, {.v = audiotogglecmd } }, 115 { 0, XF86XK_MonBrightnessUp, spawn, {.v = brightnessupcmd } }, 116 { 0, XF86XK_MonBrightnessDown, spawn, {.v = brightnessdowncmd } }, 117 { MODKEY, XK_j, focusstack, {.i = +1 } }, 118 { MODKEY, XK_Left, focusstack, {.i = +1 } }, 119 { MODKEY, XK_k, focusstack, {.i = -1 } }, 120 { MODKEY, XK_Right, focusstack, {.i = -1 } }, 121 { MODKEY, XK_i, incnmaster, {.i = +1 } }, 122 { MODKEY, XK_s, incnmaster, {.i = -1 } }, 123 { MODKEY, XK_h, setmfact, {.f = -0.05} }, 124 { MODKEY, XK_g, setmfact, {.f = +0.05} }, 125 { MODKEY, XK_z, zoom, {0} }, 126 { MODKEY, XK_Tab, view, {0} }, 127 { MODKEY|ShiftMask, XK_q, killclient, {0} }, 128 { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, 129 { MODKEY, XK_f, setlayout, {.v = &layouts[2]} }, 130 { MODKEY, XK_m, setlayout, {.v = &layouts[1]} }, 131 { MODKEY, XK_space, setlayout, {0} }, 132 { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, 133 { MODKEY, XK_0, view, {.ui = ~0 } }, 134 { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 135 { MODKEY, XK_comma, focusmon, {.i = -1 } }, 136 { MODKEY, XK_period, focusmon, {.i = +1 } }, 137 { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 138 { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 139 { Mod1Mask, XK_l, spawn, {.v = lockcmd } }, /* Define shortcut for lockcmd */ 140 TAGKEYS( XK_1, 0) 141 TAGKEYS( XK_2, 1) 142 TAGKEYS( XK_3, 2) 143 TAGKEYS( XK_4, 3) 144 TAGKEYS( XK_5, 4) 145 TAGKEYS( XK_6, 5) 146 TAGKEYS( XK_7, 6) 147 TAGKEYS( XK_8, 7) 148 TAGKEYS( XK_9, 8) 149 { MODKEY|ShiftMask, XK_e, quit, {0} }, 150 }; 151 152 /* button definitions */ 153 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ 154 static Button buttons[] = { 155 /* click event mask button function argument */ 156 { ClkLtSymbol, 0, Button1, setlayout, {0} }, 157 { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, 158 { ClkWinTitle, 0, Button2, zoom, {0} }, 159 { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, 160 { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 161 { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 162 { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 163 { ClkTagBar, 0, Button1, view, {0} }, 164 { ClkTagBar, 0, Button3, toggleview, {0} }, 165 { ClkTagBar, MODKEY, Button1, tag, {0} }, 166 { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 167 }; 168