config.def.h (9176B)
1 /* See LICENSE file for copyright and license details. */ 2 3 /* appearance */ 4 static const unsigned int borderpx = 1; /* border pixel of windows */ 5 static const unsigned int snap = 32; /* snap pixel */ 6 static const int swallowfloating = 0; /* 1 means swallow floating windows by default */ 7 static const int showbar = 1; /* 0 means no bar */ 8 static const int topbar = 1; /* 0 means bottom bar */ 9 static const char *fonts[] = { "monospace:size=10" }; 10 static const char dmenufont[] = "monospace:size=10"; 11 static const char col_gray1[] = "#222222"; 12 static const char col_gray2[] = "#444444"; 13 static const char col_gray3[] = "#bbbbbb"; 14 static const char col_gray4[] = "#eeeeee"; 15 static const char col_cyan[] = "#005577"; 16 static const char *colors[][3] = { 17 /* fg bg border */ 18 [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, 19 [SchemeSel] = { col_gray4, col_cyan, col_cyan }, 20 }; 21 22 /* tagging */ 23 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; 24 25 static const Rule rules[] = { 26 /* xprop(1): 27 * WM_CLASS(STRING) = instance, class 28 * WM_NAME(STRING) = title 29 */ 30 /* class instance title tags mask isfloating isterminal noswallow monitor */ 31 { "Gimp", NULL, NULL, 0, 1, 0, 0, -1 }, 32 { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1, -1 }, 33 { "st", NULL, NULL, 0, 0, 1, 0, -1 }, 34 { NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */ 35 }; 36 37 /* layout(s) */ 38 static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ 39 static const int nmaster = 1; /* number of clients in master area */ 40 static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ 41 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ 42 static const int refreshrate = 120; /* refresh rate (per second) for client move/resize */ 43 44 static const Layout layouts[] = { 45 /* symbol arrange function */ 46 { "[]=", tile }, /* first entry is default */ 47 { "><>", NULL }, /* no layout function means floating behavior */ 48 { "[M]", monocle }, 49 }; 50 51 /* key definitions */ 52 #define MODKEY Mod1Mask 53 #define TAGKEYS(KEY,TAG) \ 54 { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 55 { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ 56 { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ 57 { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, 58 59 /* helper for spawning shell commands in the pre dwm-5.0 fashion */ 60 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } 61 62 /* commands */ 63 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ 64 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; 65 static const char *termcmd[] = { "st", NULL }; 66 67 #include <X11/XF86keysym.h> 68 69 static const Key keys[] = { 70 /* modifier key function argument */ 71 { MODKEY, XK_p, spawn, {.v = dmenucmd } }, 72 { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, 73 { MODKEY, XK_b, togglebar, {0} }, 74 { MODKEY, XK_j, focusstack, {.i = +1 } }, 75 { MODKEY, XK_k, focusstack, {.i = -1 } }, 76 { MODKEY, XK_i, incnmaster, {.i = +1 } }, 77 { MODKEY, XK_d, incnmaster, {.i = -1 } }, 78 { MODKEY, XK_h, setmfact, {.f = -0.05} }, 79 { MODKEY, XK_l, setmfact, {.f = +0.05} }, 80 { MODKEY, XK_Return, zoom, {0} }, 81 { MODKEY, XK_Tab, view, {0} }, 82 { MODKEY|ShiftMask, XK_c, killclient, {0} }, 83 { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, 84 { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, 85 { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, 86 { MODKEY, XK_space, setlayout, {0} }, 87 { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, 88 { MODKEY, XK_0, view, {.ui = ~0 } }, 89 { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 90 { MODKEY, XK_comma, focusmon, {.i = -1 } }, 91 { MODKEY, XK_period, focusmon, {.i = +1 } }, 92 { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 93 { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 94 TAGKEYS( XK_1, 0) 95 TAGKEYS( XK_2, 1) 96 TAGKEYS( XK_3, 2) 97 TAGKEYS( XK_4, 3) 98 TAGKEYS( XK_5, 4) 99 TAGKEYS( XK_6, 5) 100 TAGKEYS( XK_7, 6) 101 TAGKEYS( XK_8, 7) 102 TAGKEYS( XK_9, 8) 103 { MODKEY|ShiftMask, XK_q, quit, {0} }, 104 { MODKEY, XK_v, spawn, SHCMD("clipmenu") }, 105 { MODKEY|ControlMask, XK_p, spawn, SHCMD("passmenu") }, 106 { MODKEY|ControlMask|ShiftMask, XK_p, spawn, SHCMD("passmenu --type") }, 107 { MODKEY, XK_grave, spawn, SHCMD("unicodemenu") }, 108 { MODKEY|ShiftMask, XK_grave, spawn, SHCMD("unicodemenu type") }, 109 { 0, XK_Print, spawn, SHCMD("maim ${XDG_PICTURES_DIR:-$HOME/Pictures}/$(date '+%y%m%d-%H%M-%S').png") }, 110 { ShiftMask, XK_Print, spawn, SHCMD("maimpick") }, 111 { 0, XF86XK_AudioPlay, spawn, SHCMD("mpc toggle") }, 112 { 0, XF86XK_AudioStop, spawn, SHCMD("mpc stop") }, 113 { 0, XF86XK_AudioPrev, spawn, SHCMD("mpc prev") }, 114 { 0, XF86XK_AudioNext, spawn, SHCMD("mpc next") }, 115 { 0, XF86XK_AudioMute, spawn, SHCMD("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && pkill -RTMIN+2 dwmblocks") }, 116 { 0, XF86XK_AudioMicMute, spawn, SHCMD("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle && pkill -RTMIN+2 dwmblocks") }, 117 { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%- && pkill -RTMIN+2 dwmblocks") }, 118 { ShiftMask, XF86XK_AudioLowerVolume, spawn, SHCMD("wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%- && pkill -RTMIN+2 dwmblocks") }, 119 { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ && pkill -RTMIN+2 dwmblocks") }, 120 { ShiftMask, XF86XK_AudioRaiseVolume, spawn, SHCMD("wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%+ && pkill -RTMIN+2 dwmblocks") }, 121 { 0, XF86XK_MonBrightnessDown, spawn, SHCMD("brightnessctl set 1%- && pkill -RTMIN+1 dwmblocks") }, 122 { ShiftMask, XF86XK_MonBrightnessDown, spawn, SHCMD("brightnessctl set 10%- && pkill -RTMIN+1 dwmblocks") }, 123 { 0, XF86XK_MonBrightnessUp, spawn, SHCMD("brightnessctl set 1%+ && pkill -RTMIN+1 dwmblocks") }, 124 { ShiftMask, XF86XK_MonBrightnessUp, spawn, SHCMD("brightnessctl set 10%+ && pkill -RTMIN+1 dwmblocks") }, 125 }; 126 127 /* button definitions */ 128 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ 129 static const Button buttons[] = { 130 /* click event mask button function argument */ 131 { ClkLtSymbol, 0, Button1, setlayout, {0} }, 132 { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, 133 { ClkWinTitle, 0, Button2, zoom, {0} }, 134 { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, 135 { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 136 { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 137 { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 138 { ClkTagBar, 0, Button1, view, {0} }, 139 { ClkTagBar, 0, Button3, toggleview, {0} }, 140 { ClkTagBar, MODKEY, Button1, tag, {0} }, 141 { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 142 }; 143