config.h (12343B) - raw


      1 /* See LICENSE file for copyright and license details. */
      2 
      3 /* appearance */
      4 static const unsigned int borderpx  = 2;        /* border pixel of windows */
      5 static const unsigned int snap      = 32;       /* snap pixel */
      6 static const unsigned int gappih    = 10;       /* horiz inner gap between windows */
      7 static const unsigned int gappiv    = 10;       /* vert inner gap between windows */
      8 static const unsigned int gappoh    = 10;       /* horiz outer gap between windows and screen edge */
      9 static const unsigned int gappov    = 10;       /* vert outer gap between windows and screen edge */
     10 static int smartgaps                = 1;        /* 1 means no outer gap when there is only one window */
     11 static const int showbar            = 1;        /* 0 means no bar */
     12 static const int topbar             = 1;        /* 0 means bottom bar */
     13 static const int swallowfloating    = 0;        /* 1 means swallow floating windows by default */
     14 static const unsigned int systraypinning = 0;   /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
     15 static const unsigned int systrayspacing = 0;   /* systray spacing */
     16 static const int systraypinningfailfirst = 1;   /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor */
     17 static const int showsystray        = 1;        /* 0 means no systray */
     18 static const char *fonts[]          = {
     19 	"monospace:size=10",
     20 	"Font Awesome 5 Free Regular:size=10",
     21 	"Font Awesome 5 Free Solid:size=10"
     22 };
     23 static const char dmenufont[]       = "monospace:size=10";
     24 static const char *colors[][3]      = {
     25 	/*               fg         bg         border   */
     26 	[SchemeNorm] = { "#eeeeee", "#000000", "#444444" },
     27 	[SchemeSel]  = { "#eeeeee", "#285577", "#a8c138" },
     28 };
     29 
     30 /* tagging */
     31 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
     32 
     33 static const Rule rules[] = {
     34 	/* xprop(1):
     35 	 *	WM_CLASS(STRING) = instance, class
     36 	 *	WM_NAME(STRING) = title
     37 	 */
     38 	/* class     instance  title    tags mask  iscentered  isfloating  isterminal  noswallow  monitor */
     39 	{ "firefox",     NULL, NULL,      1 << 1,          0,          0,          0,         1,       -1 },
     40 	{ "Signal",      NULL, NULL,      1 << 8,          0,          0,          0,         0,       -1 },
     41 	{ "Thunderbird", NULL, NULL,      1 << 6,          0,          0,          0,         0,       -1 },
     42 	{ "Alacritty",   NULL, NULL,           0,          0,          0,          1,        -1,       -1 },
     43 	{ "Pavucontrol", NULL, NULL,           0,          1,          1,          0,         1,       -1 },
     44 	{ "Gcr-prompter",NULL, NULL,           0,          1,          1,          0,         1,       -1 }, /* GPG password prompt */
     45 	{ NULL,      NULL,     "Event Tester", 0,          0,          1,          0,         1,       -1 }, /* xev */
     46 };
     47 
     48 /* layout(s) */
     49 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
     50 static const int nmaster     = 1;    /* number of clients in master area */
     51 static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
     52 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
     53 
     54 #include "layouts.c"
     55 static const Layout layouts[] = {
     56 	/* symbol     arrange function */
     57 	{ "[]=",      tile },    /* first entry is default */
     58 	{ "><>",      NULL },    /* no layout function means floating behavior */
     59 	{ "[M]",      monocle },
     60 	{ "[]D",      deck },
     61 	{ "TTT",      bstack },
     62 };
     63 
     64 /* key definitions */
     65 #define MODKEY Mod4Mask
     66 #define TAGKEYS(KEY,TAG) \
     67 	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
     68 	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
     69 	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
     70 	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
     71 
     72 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
     73 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
     74 
     75 /* commands */
     76 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
     77 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, NULL };
     78 static const char *termcmd[]  = { "alacritty", NULL };
     79 
     80 #include <X11/XF86keysym.h>
     81 static Key keys[] = {
     82 	/* modifier             key        function        argument */
     83 	/* dwm */
     84 	{ MODKEY,               XK_p,           spawn,          {.v = dmenucmd } },
     85 	{ MODKEY,               XK_Return,      spawn,          {.v = termcmd } },
     86 	{ MODKEY,               XK_KP_Enter,    spawn,          {.v = termcmd } }, /* Numeric pad return */
     87 	{ MODKEY,               XK_b,           togglebar,      {0} },
     88 	{ MODKEY,               XK_j,           focusstack,     {.i = +1 } },
     89 	{ MODKEY,               XK_k,           focusstack,     {.i = -1 } },
     90 	{ MODKEY,               XK_h,           setmfact,       {.f = -0.05} },
     91 	{ MODKEY,               XK_l,           setmfact,       {.f = +0.05} },
     92 	{ MODKEY|ShiftMask,     XK_plus,        incnmaster,     {.i = +1 } },
     93 	{ MODKEY|ShiftMask,     XK_equal,       incnmaster,     {.i = +1 } },
     94 	{ MODKEY|ShiftMask,     XK_minus,       incnmaster,     {.i = -1 } },
     95 	{ MODKEY,               XK_g,           incrgaps,       {.i = +1 } },
     96 	{ MODKEY|ShiftMask,     XK_g,           incrgaps,       {.i = -1 } },
     97 	{ MODKEY|ShiftMask,     XK_b,           togglegaps,     {0} },
     98 	{ MODKEY,               XK_space,       zoom,           {0} },
     99 	{ MODKEY,               XK_Tab,         view,           {0} }, /* previous tag */
    100 	{ MODKEY,               XK_q,           killclient,     {0} },
    101 	{ MODKEY|ShiftMask,     XK_space,       togglefloating, {0} },
    102 	{ MODKEY,               XK_0,           view,           {.ui = ~0 } }, /* all tags active */
    103 	{ MODKEY|ShiftMask,     XK_0,           tag,            {.ui = ~0 } }, /* current window to all tags */
    104 	{ MODKEY,               XK_comma,       focusmon,       {.i = -1 } }, /* previous monitor */
    105 	{ MODKEY,               XK_period,      focusmon,       {.i = +1 } }, /* next monitor */
    106 	{ MODKEY|ShiftMask,     XK_comma,       tagmon,         {.i = -1 } }, /* send window to previous monitor */
    107 	{ MODKEY|ShiftMask,     XK_period,      tagmon,         {.i = +1 } }, /* send window to next monitor */
    108 	{ MODKEY,               XK_o,           spawn,          SHCMD("session-dmenu") },
    109 	{ MODKEY|ControlMask,   XK_q,           quit,           {0} },
    110 
    111 	/* layouts */
    112 	{ MODKEY,               XK_t,           setlayout,      {.v = &layouts[0]} }, /* tile */
    113 	{ MODKEY|ShiftMask,     XK_t,           setlayout,      {.v = &layouts[1]} }, /* floating */
    114 	{ MODKEY,               XK_i,           setlayout,      {.v = &layouts[2]} }, /* monocle */
    115 	{ MODKEY|ShiftMask,     XK_i,           setlayout,      {.v = &layouts[3]} }, /* deck */
    116 	{ MODKEY|ControlMask,   XK_t,           setlayout,      {.v = &layouts[4]} }, /* bottomstack */
    117 
    118 	/* utilities */
    119 	{ 0,        XF86XK_AudioRaiseVolume,    spawn,  SHCMD("amixer -q -D pulse sset Master unmute && amixer -q -D pulse sset Master 5%+ && pkill -RTMIN+1 dwmblocks") },
    120 	{ MODKEY,   XK_plus,                    spawn,  SHCMD("amixer -q -D pulse sset Master unmute && amixer -q -D pulse sset Master 5%+ && pkill -RTMIN+1 dwmblocks") },
    121 	{ MODKEY,   XK_equal,                   spawn,  SHCMD("amixer -q -D pulse sset Master unmute && amixer -q -D pulse sset Master 5%+ && pkill -RTMIN+1 dwmblocks") },
    122 	{ ShiftMask,XF86XK_AudioRaiseVolume,    spawn,  SHCMD("amixer -q -D pulse sset Master unmute && amixer -q -D pulse sset Master 1%+ && pkill -RTMIN+1 dwmblocks") },
    123 	{ MODKEY|ShiftMask,XK_plus,             spawn,  SHCMD("amixer -q -D pulse sset Master unmute && amixer -q -D pulse sset Master 1%+ && pkill -RTMIN+1 dwmblocks") },
    124 	{ MODKEY|ShiftMask,XK_equal,            spawn,  SHCMD("amixer -q -D pulse sset Master unmute && amixer -q -D pulse sset Master 1%+ && pkill -RTMIN+1 dwmblocks") },
    125 	{ 0,        XF86XK_AudioLowerVolume,    spawn,  SHCMD("amixer -q -D pulse sset Master unmute && amixer -q -D pulse sset Master 5%- && pkill -RTMIN+1 dwmblocks") },
    126 	{ MODKEY,   XK_minus,                   spawn,  SHCMD("amixer -q -D pulse sset Master unmute && amixer -q -D pulse sset Master 5%- && pkill -RTMIN+1 dwmblocks") },
    127 	{ ShiftMask,XF86XK_AudioLowerVolume,    spawn,  SHCMD("amixer -q -D pulse sset Master unmute && amixer -q -D pulse sset Master 1%- && pkill -RTMIN+1 dwmblocks") },
    128 	{ MODKEY|ShiftMask,XK_minus,            spawn,  SHCMD("amixer -q -D pulse sset Master unmute && amixer -q -D pulse sset Master 1%- && pkill -RTMIN+1 dwmblocks") },
    129 	{ 0,        XF86XK_AudioMute,           spawn,  SHCMD("amixer -q -D pulse sset Master toggle && pkill -RTMIN+1 dwmblocks") },
    130 	{ 0,        XF86XK_MonBrightnessUp,     spawn,  SHCMD("xbacklight -inc 5 && pkill -RTMIN+2 dwmblocks") },
    131 	{ 0,        XF86XK_MonBrightnessDown,   spawn,  SHCMD("xbacklight -dec 5 && pkill -RTMIN+2 dwmblocks") },
    132 	{ ShiftMask,XF86XK_MonBrightnessUp,     spawn,  SHCMD("xbacklight -inc 1 && pkill -RTMIN+2 dwmblocks") },
    133 	{ ShiftMask,XF86XK_MonBrightnessDown,   spawn,  SHCMD("xbacklight -dec 1 && pkill -RTMIN+2 dwmblocks") },
    134 	{ MODKEY,               XK_m,           spawn,  SHCMD("mount-drive") },
    135 	{ 0,                    XK_Print,       spawn,  SHCMD("sleep 0.2 && scrot --select /tmp/screenshot-$(date +%F_%T).png --exec 'xclip -selection c -target image/png < $f'; notify-send 'Screenshot copied to clipboard'") },
    136 	{ MODKEY,               XK_s,           spawn,  SHCMD("sleep 0.2 && scrot --select /tmp/screenshot-$(date +%F_%T).png --exec 'xclip -selection c -target image/png < $f'; notify-send 'Screenshot copied to clipboard'") },
    137 	{ ShiftMask,            XK_Print,       spawn,  SHCMD("scrot /tmp/screenshot-$(date +%F_%T).png --exec 'xclip -selection c -target image/png < $f'; notify-send 'Screenshot copied to clipboard'") },
    138 	{ MODKEY|ShiftMask,     XK_s,           spawn,  SHCMD("scrot /tmp/screenshot-$(date +%F_%T).png --exec 'xclip -selection c -target image/png < $f'; notify-send 'Screenshot copied to clipboard'") },
    139 	{ MODKEY,               XK_n,           spawn,  SHCMD("mktemp | tr -d \\\\n | xclip") },
    140 	{ MODKEY|ShiftMask,     XK_n,           spawn,  SHCMD("mktemp --directory | tr -d \\\\n | xclip") },
    141 	{ ControlMask,          XK_Escape,      spawn,  SHCMD("dunstctl close") },
    142 	{ ControlMask,          XK_grave,       spawn,  SHCMD("dunstctl history-pop") },
    143 
    144 	/* applications */
    145 	{ MODKEY,               XK_f,           spawn,  SHCMD("firefox") },
    146 	{ MODKEY,               XK_x,           spawn,  SHCMD("signal-desktop") },
    147 	{ MODKEY,               XK_e,           spawn,  SHCMD("thunderbird") },
    148 	{ MODKEY,               XK_c,           spawn,  SHCMD("altpassmenu --type-all") },
    149 	{ MODKEY|ShiftMask,     XK_c,           spawn,  SHCMD("altpassmenu --type") },
    150 
    151 	/* tags */
    152 	TAGKEYS(                XK_1,           0)
    153 	TAGKEYS(                XK_2,           1)
    154 	TAGKEYS(                XK_3,           2)
    155 	TAGKEYS(                XK_4,           3)
    156 	TAGKEYS(                XK_5,           4)
    157 	TAGKEYS(                XK_6,           5)
    158 	TAGKEYS(                XK_7,           6)
    159 	TAGKEYS(                XK_8,           7)
    160 	TAGKEYS(                XK_9,           8)
    161 };
    162 
    163 /* button definitions */
    164 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    165 static Button buttons[] = {
    166 	/* click                event mask      button          function        argument */
    167 	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    168 	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    169 	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
    170 	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
    171 	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    172 	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    173 	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
    174 	{ ClkTagBar,            0,              Button1,        view,           {0} },
    175 	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
    176 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    177 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
    178 };
    179