dwm

X window manager from suckless utilities
git clone git://git.thepablogq.xyz/dwm
Log | Files | Refs | README | LICENSE

config.def.h (10399B)


      1 /* See LICENSE file for copyright and license details. */
      2 
      3 /* appearance */
      4 static const unsigned int borderpx  = 3;        /* border pixel of windows */
      5 static const unsigned int snap      = 32;       /* snap pixel */
      6 static const unsigned int gappx     = 10;        /* gap pixel between windows */
      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[]          = { "Terminus:size=10" };
     10 static const char dmenufont[]       = "Terminus: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[]       = "#000000";
     15 static const char col_green[]       = "#50fa7b";
     16 static const char col_purple[]      = "#bd93f9";
     17 static const char col1[]            = "#ffffff";
     18 static const char col2[]            = "#ffffff";
     19 static const char col3[]            = "#ffffff";
     20 static const char col4[]            = "#ffffff";
     21 static const char col5[]            = "#ffffff";
     22 static const char col6[]            = "#ffffff";
     23 static const char col7[]            = "#ffffff";
     24 static const char col8[]            = "#ffffff";
     25 static const char col9[]            = "#ffffff";
     26 static const char col10[]           = "#ffffff";
     27 static const char col11[]           = "#ffffff";
     28 static const char col12[]           = "#ffffff";
     29 
     30 #include <X11/XF86keysym.h>
     31 
     32 static const char *colors[][3]      = {
     33 	/*               fg         bg         border   */
     34 	[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
     35 	[SchemeSel]  = { col_gray4, col_green,  col_purple },
     36 	[SchemeNorm]  = { col_gray3, col_gray1, col_gray2 },
     37 	[SchemeCol1]  = { col1,      col_gray1, col_gray2 },
     38 	[SchemeCol2]  = { col2,      col_gray1, col_gray2 },
     39 	[SchemeCol3]  = { col3,      col_gray1, col_gray2 },
     40 	[SchemeCol4]  = { col4,      col_gray1, col_gray2 },
     41 	[SchemeCol5]  = { col5,      col_gray1, col_gray2 },
     42 	[SchemeCol6]  = { col6,      col_gray1, col_gray2 },
     43 	[SchemeCol7]  = { col7,      col_gray1, col_gray2 },
     44 	[SchemeCol8]  = { col8,      col_gray1, col_gray2 },
     45 	[SchemeCol9]  = { col8,      col_gray1, col_gray2 },
     46 	[SchemeCol10] = { col10,     col_gray1, col_gray2 },
     47 	[SchemeCol11] = { col11,     col_gray1, col_gray2 },
     48 	[SchemeCol12] = { col12,     col_gray1, col_gray2 },
     49 	[SchemeSel]   = { col_gray4, col_green,  col_purple  },
     50 
     51 };
     52 
     53 /* tagging */
     54 static const char *tags[] = { "1", "2", "3", "4", "FLOAT", "GRHP", "SOUND", "MAIL", "WEB" };
     55 
     56 static const Rule rules[] = {
     57 	/* xprop(1):
     58 	 *	WM_CLASS(STRING) = instance, class
     59 	 *	WM_NAME(STRING) = title
     60 	 */
     61 	/* class      instance    title       tags mask     isfloating   monitor */
     62     { "firefox",  NULL,       NULL,       1 << 8,       0,           -1 },
     63     { "Chromium", NULL,       NULL,       1 << 8,       0,           -1 }, 
     64     { "Thunderbird", "Mail",  NULL,       1 << 7,       0,            0 },
     65     { "Thunderbird", "Msgcompose",  NULL, 1 << 7,       0,            1 },
     66     { "Bitwig Studio",NULL,   NULL,       1 << 6,       0,            0 },
     67     { "Ardour-6.6.0",NULL,    NULL,       1 << 6,       0,            0 },     
     68     { "Gimp",     NULL,       NULL,       1 << 5,       0,            1 },
     69     { "QjackCtl", NULL,       NULL,       1 << 4,       1,            1 },
     70     { "st-256color", NULL,    "pulsemixer",1 << 4,      1,            1 },
     71     { "st-256color", NULL,    "pydoro",   1 << 4,       1,            1 },
     72     { "Gtick",    NULL,       NULL,       1 << 4,       1,            1 }, 
     73     { "discord", NULL,        NULL,       1 << 3,       0,            0 },
     74 };
     75 
     76 /* layout(s) */
     77 static const float mfact     = 0.50; /* factor of master area size [0.05..0.95] */
     78 static const int nmaster     = 1;    /* number of clients in master area */
     79 static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
     80 
     81 static const Layout layouts[] = {
     82 	/* symbol     arrange function */
     83 	{ "[]=",      tile },    /* first entry is default */
     84 	{ "><>",      NULL },    /* no layout function means floating behavior */
     85 	{ "[M]",      monocle },
     86 	{ "|M|",      centeredmaster },
     87 	{ ">M>",      centeredfloatingmaster },
     88 
     89 };
     90 
     91 /* key definitions */
     92 #define MODKEY Mod4Mask
     93 #define TAGKEYS(KEY,TAG) \
     94 	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
     95 	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
     96 	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
     97 	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
     98 
     99 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
    100 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
    101 
    102 /* commands */
    103 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
    104 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_green, "-sf", col_gray4, NULL };
    105 static const char *termcmd[]  = { "st", NULL };
    106 static const char *firefox[]  = { "firefox", NULL };
    107 static const char *qjack[]  = { "qjackctl", NULL };
    108 static const char *keylay[] = { "/home/plogtheg1/Source/bashScripts/keylay", NULL };
    109 static const char *upvol[]   = { "/home/plogtheg1/Source/bashScripts/upvol", "u",     NULL };
    110 static const char *downvol[] = { "/home/plogtheg1/Source/bashScripts/upvol", "d",     NULL };
    111 static const char *mutevol[] = { "/home/plogtheg1/Source/bashScripts/upvol", "m",  NULL };
    112 static const char *xflock[] = { "xflock4", NULL };
    113 static const char *mail[] = { "thunderbird", NULL };
    114 
    115 static Key keys[] = {
    116 	/* modifier                     key        function        argument */
    117 	{ ControlMask,                  XK_Escape, spawn,          {.v = dmenucmd } },
    118 	{ MODKEY|ShiftMask,             XK_w,      spawn,          {.v = firefox } },
    119 	{ MODKEY,                       XK_q,      spawn,          {.v = qjack   } },
    120 	{ MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
    121     { MODKEY|ShiftMask,             XK_m,      spawn,          {.v = mail    } },
    122 	{ Mod1Mask,                     XK_Caps_Lock,spawn,        {.v = keylay  } },
    123 	{ MODKEY,                       XK_b,      togglebar,      {0} },
    124 	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
    125 	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
    126 	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
    127 	{ MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
    128 	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
    129 	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
    130 	{ MODKEY,                       XK_Return, zoom,           {0} },
    131 	{ MODKEY,                       XK_Tab,    view,           {0} },
    132 	{ MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
    133 	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
    134 	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
    135 	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
    136 	{ MODKEY,                       XK_u,      setlayout,      {.v = &layouts[3]} },
    137 	{ MODKEY,                       XK_o,      setlayout,      {.v = &layouts[4]} },
    138 	{ MODKEY,                       XK_space,  setlayout,      {0} },
    139 	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
    140 	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
    141 	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
    142 	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
    143 	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
    144 	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
    145 	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
    146 	{ MODKEY|ShiftMask,             XK_minus,  setgaps,        {.i = -1 } },
    147 	{ MODKEY|ShiftMask,             XK_plus,   setgaps,        {.i = +1 } },
    148 	{ MODKEY|ShiftMask,             XK_equal,  setgaps,        {.i = 0  } },
    149     { ControlMask|Mod1Mask,         XK_l,      spawn,          {.v = xflock } },
    150 	TAGKEYS(                        XK_1,                      0)
    151 	TAGKEYS(                        XK_2,                      1)
    152 	TAGKEYS(                        XK_3,                      2)
    153 	TAGKEYS(                        XK_4,                      3)
    154 	TAGKEYS(                        XK_5,                      4)
    155 	TAGKEYS(                        XK_6,                      5)
    156 	TAGKEYS(                        XK_7,                      6)
    157 	TAGKEYS(                        XK_8,                      7)
    158 	TAGKEYS(                        XK_9,                      8)
    159 	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },
    160 	{ 0,                       XF86XK_AudioLowerVolume, spawn, {.v = downvol } },
    161 	{ 0,                       XF86XK_AudioMute, spawn, {.v = mutevol } },
    162 	{ 0,                       XF86XK_AudioRaiseVolume, spawn, {.v = upvol   } },
    163 };
    164 
    165 /* button definitions */
    166 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    167 static Button buttons[] = {
    168 	/* click                event mask      button          function        argument */
    169 	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    170 	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    171 	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
    172 	{ ClkStatusText,        0,              Button1,        sigdwmblocks,   {.i = 1} },
    173 	{ ClkStatusText,        0,              Button2,        sigdwmblocks,   {.i = 2} },
    174 	{ ClkStatusText,        0,              Button3,        sigdwmblocks,   {.i = 3} },	
    175 	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    176 	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    177 	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
    178 	{ ClkTagBar,            0,              Button1,        view,           {0} },
    179 	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
    180 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    181 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
    182 };
    183