config.h (9442B)
1 /* See LICENSE file for copyright and license details. */ 2 3 #include <X11/XF86keysym.h> 4 5 /* appearance */ 6 static const unsigned int borderpx = 1; /* border pixel of windows */ 7 static const unsigned int snap = 32; /* snap pixel */ 8 static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */ 9 static const unsigned int systrayonleft = 0; /* 0: systray in the right corner, >0: systray on left of status text */ 10 static const unsigned int systrayspacing = 2; /* systray spacing */ 11 static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/ 12 static const int showsystray = 1; /* 0 means no systray */ 13 static const int showbar = 1; /* 0 means no bar */ 14 static const int topbar = 1; /* 0 means bottom bar */ 15 static const char *fonts[] = { "Nova Mono:size=9", 16 "FontAwesome:size=9" }; 17 static const char dmenufont[] = "Nova Mono:size=9"; 18 static const char col_gray1[] = "#0c0c0c"; 19 static const char col_gray2[] = "#171717"; 20 static const char col_gray3[] = "#212121"; 21 static const char col_gray4[] = "#999999"; 22 static const char col_green[] = "#c6f24b"; 23 static const char *colors[][3] = { 24 /* fg bg border */ 25 [SchemeNorm] = { col_gray4, col_gray1, col_gray2 }, 26 [SchemeSel] = { col_green, col_gray3, col_green }, 27 }; 28 29 static const char *barcolors[] = { 30 "#000000", 31 "#7f0000", 32 "#007f00", 33 "#7f7f00", 34 "#00007f", 35 "#7f007f", 36 "#007f7f", 37 "#cccccc", 38 "#333333", 39 "#ff0000", 40 "#00ff00", 41 "#ffff00", 42 "#0000ff", 43 "#ff00ff", 44 "#00ffff", 45 "#ffffff", 46 }; 47 48 /* tagging */ 49 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; 50 51 static const Rule rules[] = { 52 /* xprop(1): 53 * WM_CLASS(STRING) = instance, class 54 * WM_NAME(STRING) = title 55 */ 56 /* class instance title tags mask isfloating monitor */ 57 { "Gimp", NULL, NULL, 0, 1, -1 }, 58 { "Thunderbird", NULL, NULL, 1 << 7, 0, -1 }, 59 { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, 60 { "Pale moon", NULL, NULL, 1 << 8, 0, -1 }, 61 { "Pentadactyl", NULL, NULL, 1 << 8, 0, -1 }, 62 }; 63 64 /* layout(s) */ 65 static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ 66 static const int nmaster = 1; /* number of clients in master area */ 67 static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ 68 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ 69 static const int refreshrate = 120; /* refresh rate (per second) for client move/resize */ 70 71 72 static const Layout layouts[] = { 73 /* symbol arrange function */ 74 { "[]=", tile }, /* first entry is default */ 75 { "><>", NULL }, /* no layout function means floating behavior */ 76 { "[M]", monocle }, 77 }; 78 79 /* key definitions */ 80 #define MODKEY Mod4Mask 81 #define TAGKEYS(KEY,TAG) \ 82 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 83 { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ 84 { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ 85 { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, 86 87 /* helper for spawning shell commands in the pre dwm-5.0 fashion */ 88 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } 89 90 /* commands */ 91 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ 92 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray4, "-sb", col_gray3, "-sf", col_green, NULL }; 93 static const char *termcmd[] = { "st", NULL }; 94 95 static const char *volumedown[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "-2%", NULL }; 96 static const char *volumeup[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "+2%", NULL }; 97 static const char *mute[] = { "pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL }; 98 static const char *brightnessup[] = { "brightness_adjust", "+", NULL }; 99 static const char *brightnessdown[] = { "brightness_adjust", "-", NULL }; 100 101 #define MPRIS2(x, y) static const char *mpris_##x[] = { "playerctl", #y, NULL } 102 #define MPRIS(x) MPRIS2(x, x) 103 MPRIS(previous); 104 MPRIS(play); 105 MPRIS(pause); 106 MPRIS(stop); 107 MPRIS(next); 108 MPRIS2(play_pause, play-pause); 109 110 static Key keys[] = { 111 /* modifier key function argument */ 112 { MODKEY, XK_p, spawn, {.v = dmenucmd } }, 113 { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, 114 { MODKEY|ShiftMask, XK_b, togglebar, {0} }, 115 { MODKEY, XK_j, focusstack, {.i = +1 } }, 116 { MODKEY, XK_k, focusstack, {.i = -1 } }, 117 { MODKEY, XK_i, incnmaster, {.i = +1 } }, 118 { MODKEY, XK_d, incnmaster, {.i = -1 } }, 119 { MODKEY, XK_h, setmfact, {.f = -0.05} }, 120 { MODKEY, XK_l, setmfact, {.f = +0.05} }, 121 { MODKEY, XK_Return, zoom, {0} }, 122 { MODKEY, XK_Tab, view, {0} }, 123 { MODKEY|ShiftMask, XK_c, killclient, {0} }, 124 { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, 125 { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, 126 { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, 127 { MODKEY, XK_space, setlayout, {0} }, 128 { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, 129 // { MODKEY, XK_0, view, {.ui = ~0 } }, 130 { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 131 { MODKEY, XK_comma, focusmon, {.i = -1 } }, 132 { MODKEY, XK_period, focusmon, {.i = +1 } }, 133 { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 134 { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 135 TAGKEYS( XK_1, 0) 136 TAGKEYS( XK_2, 1) 137 TAGKEYS( XK_3, 2) 138 TAGKEYS( XK_4, 3) 139 TAGKEYS( XK_5, 4) 140 TAGKEYS( XK_6, 5) 141 TAGKEYS( XK_7, 6) 142 TAGKEYS( XK_8, 7) 143 TAGKEYS( XK_9, 8) 144 { MODKEY|ShiftMask, XK_q, quit, {0} }, 145 { 0, XF86XK_AudioLowerVolume, 146 spawn, {.v = volumedown } }, 147 { 0, XF86XK_AudioRaiseVolume, 148 spawn, {.v = volumeup } }, 149 { 0, XF86XK_AudioMute, 150 spawn, {.v = mute } }, 151 { 0, XF86XK_AudioPlay, 152 spawn, {.v = mpris_play_pause } }, 153 { 0, XF86XK_AudioStop, 154 spawn, {.v = mpris_stop } }, 155 { 0, XF86XK_AudioNext, 156 spawn, {.v = mpris_next } }, 157 { 0, XF86XK_AudioPrev, 158 spawn, {.v = mpris_previous } }, 159 { 0, XF86XK_MonBrightnessUp, 160 spawn, {.v = brightnessup } }, 161 { 0, XF86XK_MonBrightnessDown, 162 spawn, {.v = brightnessdown } }, 163 { MODKEY|ShiftMask, XK_Up, spawn, {.v = volumeup } }, 164 { MODKEY|ShiftMask, XK_Down, spawn, {.v = volumedown } }, 165 { MODKEY|ShiftMask, XK_Left, spawn, {.v = brightnessup } }, 166 { MODKEY|ShiftMask, XK_Right, spawn, {.v = brightnessdown } }, 167 { MODKEY, XK_z, spawn, {.v = mpris_previous } }, 168 { MODKEY, XK_x, spawn, {.v = mpris_play } }, 169 { MODKEY, XK_c, spawn, {.v = mpris_pause } }, 170 { MODKEY, XK_v, spawn, {.v = mpris_stop } }, 171 { MODKEY, XK_b, spawn, {.v = mpris_next } }, 172 }; 173 174 /* button definitions */ 175 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ 176 static Button buttons[] = { 177 /* click event mask button function argument */ 178 { ClkTagBar, MODKEY, Button1, tag, {0} }, 179 { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 180 { ClkWinTitle, 0, Button2, zoom, {0} }, 181 { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, 182 { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 183 { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 184 { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 185 { ClkTagBar, 0, Button1, view, {0} }, 186 { ClkTagBar, 0, Button3, toggleview, {0} }, 187 { ClkTagBar, MODKEY, Button1, tag, {0} }, 188 { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 189 }; 190