The Great dwm & Suckless Hacking Thread

Don’t get me wrong, I love i3. I just prefer dwm.

1 Like

I suppose now I need to put some effort into Surf browser.

2 Likes

Current build, patches listed in the terminal:

config.h

/* See LICENSE file for copyright and license details. */

/* gaplessgrid */
#include "gaplessgrid.c"

/* multimedia keys */
#include <X11/XF86keysym.h>

/* appearance */
static const unsigned int borderpx  = 1;        /* border pixel of windows */
static const unsigned int gappx     = 3;        /* gaps between windows */
static const unsigned int snap      = 16;       /* snap pixel */
static const int showbar            = 1;        /* 0 means no bar */
static const int topbar             = 1;        /* 0 means bottom bar */
static const char buttonbar[]       = "[=]";
static const int focusonwheel       = 0;
static const char *fonts[]          = { "Inconsolata LGC Markup:Regular:size=10:antialias=true:autohint=true" };
static const char dmenufont[]       = "Inconsolata:Regular:size=11:antialias=true:autohint=true";
static const char col_gray1[]       = "#191919";
static const char col_gray2[]       = "#212121";
static const char col_gray3[]       = "#BEBEBE";
static const char col_gray4[]       = "#EEEEEE";
static const char col_gray5[]       = "#3C3C3C";
static const char col_cyan[]        = "#3D5566";
static const char *colors[][3]      = {
	/*               fg         bg         border   */
	[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
	[SchemeSel]  = { col_gray4, col_cyan,  col_gray5 },
};

/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };

static const Rule rules[] = {
	/* xprop(1):
	 *	WM_CLASS(STRING) = instance, class
	 *	WM_NAME(STRING) = title
	 */
	/* class      instance    title       tags mask     isfloating   monitor */
	{ "Gimp",     NULL,       NULL,       1 << 3,           0,           -1 },
	{ "Deadbeef", NULL,       NULL,       1 << 8,           1,           -1 },
	{ "XCalc",    NULL,       NULL,       0,                1,           -1 },
	{ "Galculator",    NULL,  NULL,       0,                1,           -1 },
	{ "mpv",      NULL,       NULL,       0,                1,           -1 },
};

/* layout(s) */
static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster     = 1;    /* number of clients in master area */
static const int resizehints = 0;    /* 1 means respect size hints in tiled resizals */

static const Layout layouts[] = {
	/* symbol     arrange function */
	{ "[T]",      tile },    /* first entry is default */
	{ "[M]",      monocle },
	{ "[G]",      gaplessgrid },
	{ "[F]",      NULL },    /* no layout function means floating behavior */
};

/* key definitions */
#define MODKEY Mod4Mask
#define ALTKEY Mod1Mask
#define TAGKEYS(KEY,TAG) \
	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },

/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }

/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[]        = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
static const char *termcmd[]         = { "st", NULL };
static const char *roficmd[]         = { "rofi", "-show", "run", NULL };
static const char *wwwcmd[]          = { "firefox", NULL };
static const char *mailcmd[]         = { "thunderbird", NULL };
static const char *filemgrcmd[]      = { "thunar", NULL };
static const char *editcmd[]         = { "subl3", NULL };
static const char *gimpcmd[]         = { "gimp", NULL };
static const char *xcalccmd[]        = { "xcalc", NULL };
/*
static const char *volupcmd[]        = { "pamixer", "-i", "5", NULL };
static const char *voldwncmd[]       = { "pamixer", "-d", "5", NULL };
static const char *volmutecmd[]      = { "pamixer", "-t", NULL };
*/
static const char *volupcmd[]        = { "amixer", "-q", "sset", "PCM", "5%+", "unmute", NULL };
static const char *voldwncmd[]       = { "amixer", "-q", "sset", "PCM", "5%-", "unmute", NULL };
static const char *volmutecmd[]      = { "amixer", "set", "Master", "toggle", "-q", NULL };
static const char *mediaplay[]       = { "deadbeef", "--toggle-pause", NULL };
static const char *mediaprev[]       = { "deadbeef", "--prev", NULL };
static const char *medianext[]       = { "deadbeef", "--next", NULL };
static const char *calccmd[]         = { "libreoffice", "--calc",   NULL };
static const char *doccmd[]          = { "libreoffice", "--writer", NULL };
static const char *exitcmd[]         = { "rofi-logout", NULL };
static const char *tmuxcmd[]         = { "uxterm", "-title", "tmux", "-e", "tmux", NULL };
static const char *mcfmcmd[]         = { "uxterm", "-title", "mcfm", "-e", "mc", NULL };
static const char *jgmenucmd[]       = { "jgmenu", "--config-file=~/.config/jgmenu/jgmouserc", NULL };
static const char *barmenucmd[]      = { "jgmenu_run", NULL };

static Key keys[] = {
	/* modifier                     key        function        argument */
	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
	{ MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
	{ ALTKEY,                       XK_F2,     spawn,          {.v = roficmd } },
	{ ALTKEY,                       XK_F1,     spawn,          {.v = termcmd } },
	{ MODKEY,                       XK_F1,     spawn,          {.v = tmuxcmd } },
	{ MODKEY,                       XK_F2,     spawn,          {.v = mcfmcmd } },
/*                                                                                        */
	{ 0,                            XK_Menu,                   spawn,    {.v = filemgrcmd } },
	{ 0,                            XF86XK_Calculator,         spawn,    {.v = xcalccmd } },
	{ 0,                            XF86XK_AudioRaiseVolume,   spawn,    {.v = volupcmd } },
	{ 0,                            XF86XK_AudioLowerVolume,   spawn,    {.v = voldwncmd } },
	{ 0,                            XF86XK_AudioMute,          spawn,    {.v = volmutecmd } },
	{ 0,                            XF86XK_AudioPlay,          spawn,    {.v = mediaplay } },
    { 0,                            XF86XK_AudioPrev,          spawn,    {.v = mediaprev } },
    { 0,                            XF86XK_AudioNext,          spawn,    {.v = medianext } },
	{ MODKEY|ShiftMask,             XK_q,                      spawn,    {.v = exitcmd } },
	{ 0,                            XF86XK_HomePage,           spawn,    {.v = wwwcmd } },
	{ 0,                            XF86XK_Search,             spawn,    {.v = mailcmd } },
	{ MODKEY|ControlMask,           XK_l,                      spawn,    {.v = editcmd } },
	{ MODKEY|ControlMask,           XK_g,                      spawn,    {.v = gimpcmd } },
	{ MODKEY|ControlMask,           XK_p,                      spawn,    {.v = calccmd } },
	{ MODKEY|ControlMask,           XK_o,                      spawn,    {.v = doccmd } },
	{ MODKEY|ControlMask,           XK_Print,  spawn,          SHCMD("~/bin/screenshot.sh full") },
	{ ALTKEY|ControlMask,           XK_Print,  spawn,          SHCMD("~/bin/screenshot.sh window") },
	{ MODKEY,                       XK_b,      togglebar,      {0} },
	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
	{ ALTKEY,                       XK_Tab,    focusstack,     {.i = +1 } },
	{ ALTKEY|ShiftMask,             XK_Tab,    focusstack,     {.i = -1 } },
	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
	{ MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
	{ MODKEY,                       XK_Return, zoom,           {0} },
	{ MODKEY,                       XK_Tab,    view,           {0} },
	{ MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
	{ ALTKEY,                       XK_F4,     killclient,     {0} },
	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[1]} },
	{ MODKEY,                       XK_g,      setlayout,      {.v = &layouts[2]} },
	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[3]} },
	{ MODKEY,                       XK_space,  setlayout,      {0} },
	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
	{ MODKEY,                       XK_Down,   moveresize,     {.v = "0x 25y 0w 0h" } },
	{ MODKEY,                       XK_Up,     moveresize,     {.v = "0x -25y 0w 0h" } },
	{ MODKEY,                       XK_Right,  moveresize,     {.v = "25x 0y 0w 0h" } },
	{ MODKEY,                       XK_Left,   moveresize,     {.v = "-25x 0y 0w 0h" } },
	{ MODKEY|ShiftMask,             XK_Down,   moveresize,     {.v = "0x 0y 0w 25h" } },
	{ MODKEY|ShiftMask,             XK_Up,     moveresize,     {.v = "0x 0y 0w -25h" } },
	{ MODKEY|ShiftMask,             XK_Right,  moveresize,     {.v = "0x 0y 25w 0h" } },
	{ MODKEY|ShiftMask,             XK_Left,   moveresize,     {.v = "0x 0y -25w 0h" } },
	{ MODKEY|ControlMask,           XK_Up,     moveresizeedge, {.v = "t"} },
	{ MODKEY|ControlMask,           XK_Down,   moveresizeedge, {.v = "b"} },
	{ MODKEY|ControlMask,           XK_Left,   moveresizeedge, {.v = "l"} },
	{ MODKEY|ControlMask,           XK_Right,  moveresizeedge, {.v = "r"} },
	{ MODKEY|ControlMask|ShiftMask, XK_Up,     moveresizeedge, {.v = "T"} },
	{ MODKEY|ControlMask|ShiftMask, XK_Down,   moveresizeedge, {.v = "B"} },
	{ MODKEY|ControlMask|ShiftMask, XK_Left,   moveresizeedge, {.v = "L"} },
	{ MODKEY|ControlMask|ShiftMask, XK_Right,  moveresizeedge, {.v = "R"} },
	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
	TAGKEYS(                        XK_1,                      0)
	TAGKEYS(                        XK_2,                      1)
	TAGKEYS(                        XK_3,                      2)
	TAGKEYS(                        XK_4,                      3)
	TAGKEYS(                        XK_5,                      4)
	TAGKEYS(                        XK_6,                      5)
	TAGKEYS(                        XK_7,                      6)
	TAGKEYS(                        XK_8,                      7)
	TAGKEYS(                        XK_9,                      8)
	{ MODKEY|ShiftMask,             XK_e,      quit,           {0} },
};

/* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
	/* click                event mask      button          function        argument */
	{ ClkButton,		    0,		        Button1,	    spawn,		    {.v = barmenucmd } },
	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
	{ ClkClientWin,         ALTKEY,         Button1,        movemouse,      {0} },
	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
	{ ClkClientWin,         ALTKEY,         Button3,        resizemouse,    {0} },
	{ ClkTagBar,            0,              Button1,        view,           {0} },
	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
	{ ClkRootWin,           0,              Button1,        spawn,          {.v = jgmenucmd } },
};

1 Like

I have gone back to being barless, using an already heavily patched build I came across by a guy called bakkeby. This dude is a frickin’ dwm magician. The guy behind Flexi-patch.

This is the original build I am using (it seems it has been archived recently). I have added some other patches to make this suit me even further:

  • Scratchpad
  • focusonactive
  • noborder

There are a couple of others but I can’t quite remember what they are.

I’m still manually patching, its time consuming but I get a result without errors. Though I tried adding the hide vacant tags but ended up with an endless login logout loop.

2 posts were split to a new topic: Open apps on dedicated tags

What does scratchpad do? I’ve seen it mentioned before but never investigated.

Basically opens a terminal with a key bind anywhere on any tag.

Sounds very efficient.

Super handy man, I’m lost without my scratchpad.

You should probably shave man!

1 Like

I plan on it.

totally newbie question on dwm, when you install archlabs with dwm has it allready some theming and a bar and is it usable out of the box?
Or you do it yourself?

It is semi-themed. The bar is the standard dwm-bar that comes with dwm.

You can mess around and replace dwm-bar with lemonbar or polybar but you need some patching magic there, especially for polybar.

tnx for the info

Mine is very boring, very small changes.

/* appearance */
static const unsigned int borderpx  = 1;        /* border pixel of windows */
static const unsigned int snap      = 30;       /* snap pixel */
static const int showbar            = 1;        /* 0 means no bar */
static const int topbar             = 1;        /* 0 means bottom bar */
static const char *fonts[]          = { "hack :size=10" };
static const char dmenufont[]       = "hack :size=10";
static const char col_gray1[]       = "#2C3235";
static const char col_gray2[]       = "#879598";
static const char col_gray3[]       = "#879598";
static const char col_gray4[]       = "#2C3235";
static const char col_cyan[]        = "#879598";
static const char *colors[][3]      = {
	/*               fg         bg         border   */
	[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
	[SchemeSel]  = { col_gray4, col_cyan,  col_cyan  },
};

/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };

static const Rule rules[] = {
	/* xprop(1):
	 *	WM_CLASS(STRING) = instance, class
	 *	WM_NAME(STRING) = title
	 */
	/* class      instance    title       tags mask     isfloating   monitor */
	{ "Gimp",     NULL,       NULL,       0,            1,           -1 },
	{ "Firefox",  NULL,       NULL,       0,            0,           -1 },
};

/* layout(s) */
static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster     = 1;    /* number of clients in master area */
static const int resizehints = 0;    /* 1 means respect size hints in tiled resizals */

static const Layout layouts[] = {
	/* symbol     arrange function */
	{ "[]=",      tile },    /* first entry is default */
	{ "><>",      NULL },    /* no layout function means floating behavior */
	{ "[M]",      monocle },
};

/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },

/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }

/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
static const char *termcmd[]  = { "st", NULL };
static const char *browsercmd[]  = { "firefox", NULL };
static const char *thunarcmd[]  = { "thunar", NULL };

static Key keys[] = {
	/* modifier                     key        function        argument */
	{ MODKEY,                       XK_d,      spawn,          {.v = dmenucmd } },
	{ MODKEY,             		    XK_Return, spawn,          {.v = termcmd } },
	{ MODKEY,             		    XK_w,      spawn,          {.v = browsercmd } },
	{ MODKEY|ShiftMask,             XK_f,      spawn,          {.v = thunarcmd } },
	{ MODKEY,                       XK_b,      togglebar,      {0} },
	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
	{ MODKEY|ShiftMask,             XK_d,      incnmaster,     {.i = -1 } },
	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
	{ MODKEY|ShiftMask,             XK_Return, zoom,           {0} },
	{ MODKEY,                       XK_Tab,    view,           {0} },
	{ MODKEY,                       XK_q,      killclient,     {0} },
	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
	{ MODKEY|ShiftMask,             XK_f,      setlayout,      {.v = &layouts[1]} },
	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
	{ MODKEY,                       XK_f,      fullscreen,     {0} },
	{ MODKEY,                       XK_space,  setlayout,      {0} },
	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
	TAGKEYS(                        XK_1,                      0)
	TAGKEYS(                        XK_2,                      1)
	TAGKEYS(                        XK_3,                      2)
	TAGKEYS(                        XK_4,                      3)
	TAGKEYS(                        XK_5,                      4)
	TAGKEYS(                        XK_6,                      5)
	TAGKEYS(                        XK_7,                      6)
	TAGKEYS(                        XK_8,                      7)
	TAGKEYS(                        XK_9,                      8)
	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },
};

/* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
	/* click                event mask      button          function        argument */
	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
	{ ClkTagBar,            0,              Button1,        view,           {0} },
	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
};
3 Likes

Nice @Beast

This is my current implementation

/* See LICENSE file for copyright and license details. */

/* appearance */
static const unsigned int borderpx       = 1;   /* border pixel of windows */
static const unsigned int snap           = 32;  /* snap pixel */
static const unsigned int gappih         = 10;  /* horiz inner gap between windows */
static const unsigned int gappiv         = 10;  /* vert inner gap between windows */
static const unsigned int gappoh         = 10;   /* horiz outer gap between windows and screen edge */
static const unsigned int gappov         = 10;   /* vert outer gap between windows and screen edge */
static const int smartgaps               = 1;   /* 1 means no outer gap when there is only one window */
static const int showbar                 = 0;   /* 0 means no bar */
static const int topbar                  = 1;   /* 0 means bottom bar */
static const int horizpadbar             = 6;   /* horizontal padding for statusbar */
static const int vertpadbar              = 10;   /* vertical padding for statusbar */
static const int focusonnetactive        = 1;   /* 0 means default behaviour, 1 means auto-focus on urgent window */
static const int attachmode              = 2;   /* 0 = master (default), 1 = above, 2 = aside, 3 = below, 4 = bottom */
static const int pertag                  = 1;   /* 0 means global layout across all tags (default), 1 = layout per tag (pertag) */
static const int pertagbar               = 0;   /* 0 means using pertag, but with the same barpos, 1 = normal pertag */
static const int zoomswap                = 1;   /* 0 means default behaviour, 1 = zoomswap patch */
static const int fancybar                = 1;   /* 0 means default behaviour, 1 = fancybar patch */
static const int savefloats              = 1;   /* 0 means default behaviour, 1 = savefloats patch */
static const int losefullscreen          = 1;   /* 0 means default behaviour, 1 = losefullscreen patch */
static const int nrg_force_vsplit        = 1;   /* nrowgrid layout, 1 means force 2 clients to always split vertically */
static const unsigned int systraypinning = 1;   /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
static const unsigned int systrayspacing = 0;   /* systray spacing */
static const int systraypinningfailfirst = 1;   /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/
static const int showsystray             = 0;   /* 0 means no systray */
static const char *fonts[]         		 = {"Inter:style=Regular:size=10", "Font Awesome 5 Pro:style=Solid:pixelsize=12:antialias=true", "Font Awesome 5 Brands:style=Solid:pixelsize=12:antialias=true", "Material Design Icons:Regular:pixelsize=22:antialias=true"};
static const char dmenufont[]            = "SF Pro Text:size=5";
static const char col_gray1[]            = "#141414";
static const char col_gray2[]            = "#505050";
static const char col_gray3[]            = "#353535";
static const char col_gray4[]            = "#c6c6c6";
static const char col_gray5[]            = "#fffefe";
static const char col_gray6[]            = "#292929";
static const char col_gray7[]            = "#212121";
static const char col_cyan[]             = "#7e9cb9";
static const char col_blue[]			 = "#6699cc";
/*static const unsigned int baralpha       = 0xd0;*/
/*static const unsigned int baralpha       = 225;*/
static const unsigned int baralpha       = 235;
static const unsigned int borderalpha    = 255;
static const char *colors[][3] = {
	/*               fg         bg         border   */
	[SchemeNorm] = { col_gray4, col_gray1, col_gray2 },
	[SchemeSel]  = { col_gray5, col_gray6,  col_gray7  },
};
static const unsigned int alphas[][3] = {
	/*               fg      bg        border     */
	[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
	[SchemeSel]  = { OPAQUE, baralpha, borderalpha },
};

/* tagging */
static const char *tags[] = { "", "", "", "", "", "", "", "", "", "" };
/*static const char *tags[] = { "", "", "", "", "", "", "", "", "", "" };*/

static const Rule rules[] = {
	/* xprop(1):
	 *	WM_CLASS(STRING) = instance, class
	 *	WM_NAME(STRING) = title
	 *  WM_WINDOW_ROLE(STRING) = role
	 */
	/* class            role                          instance     title   tags mask  switchtag  iscentered   isfloating   monitor */
	{ "qutebrowser",    NULL,                         NULL,        NULL,   1,	      1,         0,           0,            0 },
	{ "Brave-browser",  NULL,                         NULL,        NULL,   1,	      1,         0,           0,            0 },
	{ "firefox",        NULL,                         NULL,        NULL,   1,	      1,         0,           0,            0 },
	{ "Nightly",        NULL,                         NULL,        NULL,   1,	      1,         0,           0,            0 },
	{ "Google-chrome",  NULL,                         NULL,        NULL,   1,	      1,         0,           0,            0 },
	{ "Vivaldi-stable", NULL,                         NULL,        NULL,   1,	      1,         0,           0,            0 },
	{ "Surf",           NULL,                         NULL,        NULL,   1,	      1,         0,           0,            0 },
	{ "ncmpcpp",   		NULL,  				  		  NULL,   	   NULL,   1 << 3,    1,         0,			  0,		    1 },
	{ "St",	            NULL,                         NULL,        NULL,   1 << 1,    1,         0,           0,            0 },
	{ "Transmission-gtk",NULL,                        NULL,        NULL,   1 << 2,    1,         0,           0,            0 },
	{ "SoulseekQt",		NULL,                         NULL,        NULL,   1 << 2,    1,         0,           0,            0 },
	{ "Thunar",		    NULL,                         NULL,        NULL,   1 << 4,    1,         0,           0,            0 },
	{ "File-roller",    NULL,                         NULL,        NULL,   1 << 4,    1,         1,           1,            0 },
	{ "mpv",          	NULL,                         NULL,        NULL,   1 << 4,    1,         0,           1,            0 },
	{ "Subl3",		    NULL,                         NULL,        NULL,   1 << 6,    1,         0,           0,            0 },
	{ "Code",		    NULL,                         NULL,        NULL,   1 << 6,    1,         0,           0,            0 },
	{ "Steam",          NULL,                         NULL,        NULL,   1 << 7,    1,         0,           0,            0 },
	{ "Slack",          NULL,                         NULL,        NULL,   1 << 7,    1,         0,           0,            1 },
	{ "Easytag",	    NULL,                         NULL,        NULL,   1 << 8,    1,         1,           0,            0 },
	{ "Xfce4-taskmanager",NULL,                       NULL,        NULL,   1 << 9,    1,         1,           0,            0 },
	{ "Nitrogen",		NULL,                         NULL,        NULL,   1 << 9,    1,         1,           1,            1 },
	{ "Xfce4-appearance-settings", NULL, 			  NULL, 	   NULL,   1 << 9,    1,         1,    		  1,            0 },
	{ "Xfce4-mouse-settings", NULL, 			  	  NULL, 	   NULL,   1 << 9,    1,         1,    		  1,            0 },
    { "Lxappearance",   NULL, 			  			  NULL, 	   NULL,   1 << 9,    1,         1,    		  1,            1 },
    { "Blueman-manager", NULL, 			  			  NULL, 	   NULL,   1 << 9,    1,         1,    		  1,            1 },
    { "Gimp", 			NULL, 			  			  NULL, 	   NULL,   1 << 9,    1,         1,    		  1,            0 },
    { "firefox",		"GtkFileChooserDialog",       "Save File", NULL,   0,         0,         1,           1,            0 },
};

/* layout(s) */
static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster     = 1;    /* number of clients in master area */
static const int resizehints = 0;    /* 1 means respect size hints in tiled resizals */

#include "vanitygaps.c"

static const int layoutaxis[] = {
	SPLIT_VERTICAL,   /* layout axis: 1 = x, 2 = y; negative values mirror the layout, setting the master area to the right / bottom instead of left / top */
	TOP_TO_BOTTOM,    /* master axis: 1 = x (from left to right), 2 = y (from top to bottom), 3 = z (monocle), 4 = grid */
	TOP_TO_BOTTOM,    /* stack axis:  1 = x (from left to right), 2 = y (from top to bottom), 3 = z (monocle), 4 = grid */
};

static const Layout layouts[] = {
	/* symbol	arrange function */
	{ "󰕴",	dwindle }, /* first entry is default */
	{ "󰙀",	tile },
	{ "󰕰", grid },
	{ "󰕫", centeredmaster },
	{ "󰕬", centeredfloatingmaster },
	{ "󰕯",	NULL },    /* no layout function means floating behavior */
	{ "󰾍",	bstack },
	{ "󱇚",	bstackhoriz },
	{ "󱒈",	gaplessgrid },
	{ "󰕭",	horizgrid },
	{ "󱒇",	nrowgrid },
	{ "󰡃",	spiral },
	{ "󰃚",	monocle },
	{ "󱒉",	deck },
	{ NULL,	NULL },
};

/* key definitions */
#define MODKEY Mod1Mask
#define TAGKEYS(KEY,TAG) \
	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
	
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }

/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run_history", NULL };
static const char *roficmd[] = { "rofi", "-show", "drun", "-show-icons", NULL };
/*static const char *scrotcmd[] = {"/usr/bin/scr", NULL};*/
static const char *scrotcmd[] = {"teiler", NULL};
static const char *termcmd[]  = { "st", NULL };
/*static const char *browsercmd[] = { "firefox", NULL };*/
static const char *browsercmd[] = { "brave", NULL };
/*static const char *altbrowsercmd[] = { "qutebrowser", NULL };*/
static const char *exitcmd[] = { "/usr/bin/stop.sh", NULL };
static const char *munext[]  = { "/usr/bin/mpc", "next", NULL };
static const char *muprev[]  = { "/usr/bin/mpc", "prev", NULL };
static const char *mupause[]  = { "/usr/bin/mpc", "toggle", NULL };
static const char *filecmd[] = { "thunar", NULL };
static const char *editcmd[] = { "subl3", NULL };
static const char *vimcmd[] = { "gvim", NULL };
static const char scratchpadname[] = "scratchpad";
static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34", NULL };

#include <X11/XF86keysym.h>
static Key keys[] = {
	/* modifier                     key        function           argument */
	{ MODKEY,                       XK_space,  spawn,             {.v = dmenucmd } },
	{ MODKEY, 						XK_d,  	   spawn, 			  {.v = roficmd } },
	{ MODKEY,                       XK_t, 	   spawn,             {.v = termcmd } },
	{ MODKEY,                       XK_grave,  togglescratch,  	  {.v = scratchpadcmd } },
	{ MODKEY,			            XK_b,      togglebar,         {0} },
	{ MODKEY,                       XK_j,      focusstack,        {.i = +1 } },
	{ MODKEY,                       XK_k,      focusstack,        {.i = -1 } },
	{ MODKEY|Mod1Mask,              XK_j,      rotatestack,       {.i = +1 } },
	{ MODKEY|Mod1Mask,              XK_k,      rotatestack,       {.i = -1 } },
	{ MODKEY,                       XK_i,      incnmaster,        {.i = +1 } },
	{ MODKEY,                       XK_u,      incnmaster,        {.i = -1 } },
	{ MODKEY,                       XK_h,      setmfact,          {.f = -0.05} },
	{ MODKEY|ControlMask,           XK_l,      setmfact,          {.f = +0.05} },
	{ MODKEY|ShiftMask,             XK_h,      setcfact,          {.f = +0.25} },
	{ MODKEY|ShiftMask,             XK_l,      setcfact,          {.f = -0.25} },
	{ MODKEY|ShiftMask,             XK_o,      setcfact,          {.f =  0.00} },
	{ MODKEY|Mod1Mask,              XK_m,      zoom,              {0} },
	{ MODKEY|Mod1Mask,              XK_u,      incrgaps,          {.i = +1 } },
	{ MODKEY|Mod1Mask|ShiftMask,    XK_u,      incrgaps,          {.i = -1 } },
	{ MODKEY|Mod1Mask,              XK_i,      incrigaps,         {.i = +1 } },
	{ MODKEY|Mod1Mask|ShiftMask,    XK_i,      incrigaps,         {.i = -1 } },
	{ MODKEY|Mod1Mask,              XK_o,      incrogaps,         {.i = +1 } },
	{ MODKEY|Mod1Mask|ShiftMask,    XK_o,      incrogaps,         {.i = -1 } },
	{ MODKEY|Mod1Mask,              XK_6,      incrihgaps,        {.i = +1 } },
	{ MODKEY|Mod1Mask|ShiftMask,    XK_6,      incrihgaps,        {.i = -1 } },
	{ MODKEY|Mod1Mask,              XK_7,      incrivgaps,        {.i = +1 } },
	{ MODKEY|Mod1Mask|ShiftMask,    XK_7,      incrivgaps,        {.i = -1 } },
	{ MODKEY|Mod1Mask,              XK_8,      incrohgaps,        {.i = +1 } },
	{ MODKEY|Mod1Mask|ShiftMask,    XK_8,      incrohgaps,        {.i = -1 } },
	{ MODKEY|Mod1Mask,              XK_9,      incrovgaps,        {.i = +1 } },
	{ MODKEY|Mod1Mask|ShiftMask,    XK_9,      incrovgaps,        {.i = -1 } },
	{ MODKEY|Mod1Mask,              XK_0,      togglegaps,        {0} },
	{ MODKEY|Mod1Mask|ShiftMask,    XK_0,      defaultgaps,       {0} },
	{ MODKEY,                       XK_Tab,    view,              {0} },
	{ Mod1Mask,                     XK_Tab,    view,              {0} },
	{ Mod1Mask|ControlMask,         XK_Tab,    view,              {0} },
	{ MODKEY,                       XK_q,      killclient,        {0} },
	{ MODKEY|Mod1Mask|ControlMask,  XK_1,      setlayout,         {.v = &layouts[0]} },
	{ MODKEY|Mod1Mask|ControlMask,  XK_2,      setlayout,         {.v = &layouts[1]} },
	{ MODKEY|Mod1Mask|ControlMask,  XK_3,      setlayout,         {.v = &layouts[2]} },
	{ MODKEY|Mod1Mask|ControlMask,  XK_4,      setlayout,         {.v = &layouts[3]} },
	{ MODKEY|Mod1Mask|ControlMask,  XK_5,      setlayout,         {.v = &layouts[4]} },
	{ MODKEY|Mod1Mask|ControlMask,  XK_6,      setlayout,         {.v = &layouts[5]} },
	{ MODKEY|Mod1Mask|ControlMask,  XK_7,      setlayout,         {.v = &layouts[6]} },
	{ MODKEY|Mod1Mask|ControlMask,  XK_8,      setlayout,         {.v = &layouts[7]} },
	{ MODKEY|Mod1Mask|ControlMask,  XK_9,      setlayout,         {.v = &layouts[8]} },
	{ MODKEY|Mod1Mask|ControlMask,  XK_0,      setlayout,         {.v = &layouts[9]} },
	{ MODKEY|Mod1Mask|ControlMask,  XK_w,      setflexlayout,     {.i = 293 } }, // centered master
	{ MODKEY|ControlMask,           XK_e,      setflexlayout,     {.i = 273 } }, // bstackhoriz layout
	{ MODKEY,                       XK_r,      setflexlayout,     {.i = 272 } }, // bstack layout
	{ MODKEY|ControlMask,           XK_t,      setflexlayout,     {.i = 261 } }, // default tile layout
	{ MODKEY|ShiftMask,             XK_g,      setflexlayout,     {.i = 263 } }, // tile + grid layout
	{ MODKEY|ControlMask,           XK_w,      setflexlayout,     {.i =   7 } }, // grid
	{ MODKEY|Mod1Mask|ControlMask,  XK_e,      setflexlayout,     {.i = 262 } }, // deck layout
	{ MODKEY|ControlMask,           XK_r,      setflexlayout,     {.i =   6 } }, // monocle
	{ MODKEY|ControlMask,           XK_g,      setflexlayout,     {.i = 257 } }, // columns (col) layout
	{ MODKEY|ControlMask,           XK_space,  setlayout,         {0} },
	{ MODKEY|ShiftMask,             XK_space,  togglefloating,    {0} },
	{ MODKEY|ShiftMask,             XK_f,      togglefullscreen,  {0} },
	{ MODKEY,                       XK_n,      view,              {.ui = ~0 } },
	{ MODKEY|ShiftMask,             XK_0,      tag,               {.ui = ~0 } },
	{ MODKEY,                       XK_comma,  focusmon,          {.i = -1 } },
	{ MODKEY,                       XK_period, focusmon,          {.i = +1 } },
	{ MODKEY|ControlMask,           XK_comma,  cyclelayout,       {.i = -1 } },
	{ MODKEY|ControlMask,           XK_period, cyclelayout,       {.i = +1 } },
	{ MODKEY|Mod1Mask,              XK_comma,  tagmon,            {.i = +1 } },
	{ MODKEY|Mod1Mask,              XK_period, tagmon,            {.i = -1 } },
	{ MODKEY|Mod1Mask|ShiftMask,    XK_comma,  tagallmon,         {.i = +1 } },
	{ MODKEY|Mod1Mask|ShiftMask,    XK_period, tagallmon,         {.i = -1 } },
	{ MODKEY|Mod1Mask|ControlMask,  XK_comma,  tagswapmon,        {.i = +1 } },
	{ MODKEY|Mod1Mask|ControlMask,  XK_period, tagswapmon,        {.i = -1 } },
	TAGKEYS(                        XK_1,                         0)
	TAGKEYS(                        XK_2,                         1)
	TAGKEYS(                        XK_3,                         2)
	TAGKEYS(                        XK_4,                         3)
	TAGKEYS(                        XK_5,                         4)
	TAGKEYS(                        XK_6,                         5)
	TAGKEYS(                        XK_7,                         6)
	TAGKEYS(                        XK_8,                         7)
	TAGKEYS(                        XK_9,                         8)
	TAGKEYS(                        XK_0,                         9)
	TAGKEYS(                        XK_F1,                        0)
	TAGKEYS(                        XK_F2,                        1)
	TAGKEYS(                        XK_F3,                        2)
	TAGKEYS(                        XK_F4,                        3)
	TAGKEYS(                        XK_F5,                        4)
	TAGKEYS(                        XK_F6,                        5)
	TAGKEYS(                        XK_F7,                        6)
	TAGKEYS(                        XK_F8,                        7)
	TAGKEYS(                        XK_F9,                        8)
	TAGKEYS(                        XK_F10,                       9)
	{ MODKEY|ShiftMask,             XK_q,      quit,              {0} },
	{ MODKEY|ControlMask,           XK_t,      rotatelayoutaxis,  {.i = 0} },    /* flextile, 0 = layout axis */
	{ MODKEY|ControlMask,           XK_Tab,    rotatelayoutaxis,  {.i = 1} },    /* flextile, 1 = master axis */
	{ MODKEY|ControlMask|ShiftMask, XK_Tab,    rotatelayoutaxis,  {.i = 2} },    /* flextile, 2 = stack axis */
	{ MODKEY|ControlMask,           XK_Return, mirrorlayout,      {0} },         /* flextile, flip master and stack areas */
	{ 0,							XK_Print,	spawn,			{.v = scrotcmd } },
	{ 0, XF86XK_AudioMute,			spawn,						SHCMD("amixer sset Master toggle") },
	{ 0, XF86XK_AudioRaiseVolume,	spawn,						SHCMD("/usr/bin/volume up") },
	{ 0, XF86XK_AudioLowerVolume,	spawn,						SHCMD("/usr/bin/volume down") },
	{ 0, XF86XK_AudioPrev,			spawn,		 				{.v = muprev } },
	{ 0, XF86XK_AudioNext,			spawn,						{.v = munext } },
	{ 0, XF86XK_AudioPause,			spawn,						{.v = mupause } },
	{ 0, XF86XK_AudioPlay,			spawn,						{.v = mupause } },
	{ 0, XF86XK_AudioStop,			spawn,						{.v = mupause } },
	{ 0, XF86XK_AudioRewind,		spawn,						SHCMD("mpc seek -10") },
	{ 0, XF86XK_AudioForward,		spawn,						SHCMD("mpc seek +10") },
	{ MODKEY,						XK_w,		spawn,			{.v = browsercmd } },
	/*{ MODKEY|ShiftMask,				XK_w,		spawn,			SHCMD("QT_SCALE_FACTOR=0.5 qutebrowser") },*/
	{ MODKEY|ShiftMask,				XK_w,		spawn,			SHCMD("qutebrowser") },
	{ MODKEY|Mod1Mask,				XK_w,		spawn,			SHCMD("google-chrome-stable") },
	{ MODKEY,						XK_x,		spawn,			{.v = exitcmd } },
	{ MODKEY,						XK_e,		spawn,			{.v = editcmd } },
	{ MODKEY|ShiftMask, 			XK_e,		spawn,			{.v = vimcmd } },
	{ MODKEY|ShiftMask,				XK_p,		spawn,			SHCMD("rofi -modi \"clipboard:greenclip print\" -show clipboard -run-command '{cmd}'") },
	/*{ MODKEY|ShiftMask,				XK_p,		spawn,			SHCMD("clipmenu") },*/
	/*{ MODKEY,						XK_b,		spawn,		    SHCMD("buku-dmenu") },*/
	/*{ MODKEY,						XK_m,		spawn,			SHCMD("st -c ncmpcpp -e ncmpcpp -S media_library") },*/
	{ MODKEY,						XK_m,		spawn,			SHCMD("st -c ncmpcpp -e ncmpcpp") },
	{ MODKEY|ShiftMask,				XK_m,		spawn,			SHCMD("QT_SCALE_FACTOR=0.5 audacious") },
	{ MODKEY,						XK_f,		spawn,			{.v = filecmd } },
	{ MODKEY,						XK_l,       spawn,		    SHCMD("slock") },
};
 
/* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
	/* click                event mask         button          function        argument */
	{ ClkLtSymbol,          0,                 Button1,        setlayout,      {0} },
	{ ClkLtSymbol,          0,                 Button3,        setlayout,      {.v = &layouts[2]} },
	{ ClkLtSymbol,          0,                 Button4,        cyclelayout,    {.i = +1 } },
	{ ClkLtSymbol,          0,                 Button5,        cyclelayout,    {.i = -1 } },
	{ ClkWinTitle,          0,                 Button2,        zoom,           {0} },
	{ ClkStatusText,        0,                 Button2,        spawn,          {.v = termcmd } },
	{ ClkClientWin,         MODKEY,            Button1,        movemouse,      {0} },
	{ ClkClientWin,         MODKEY|Mod1Mask,   Button2,        togglefloating, {0} },
	{ ClkClientWin,         MODKEY,            Button3,        resizemouse,    {0} },
	{ ClkClientWin,         MODKEY,            Button4,        rotatestack,    {.i = +1 } },
	{ ClkClientWin,         MODKEY,            Button5,        rotatestack,    {.i = -1 } },
	{ ClkClientWin,         MODKEY,            Button2,        zoom,           {0} },
	{ ClkClientWin,         MODKEY|Mod1Mask,   Button4,        cyclelayout,    {.i = -1 } },
	{ ClkClientWin,         MODKEY|Mod1Mask,   Button5,        cyclelayout,    {.i = +1 } },
	{ ClkTagBar,            0,                 Button1,        view,           {0} },
	{ ClkTagBar,            0,                 Button3,        toggleview,     {0} },
	{ ClkTagBar,            MODKEY,            Button1,        tag,            {0} },
	{ ClkTagBar,            MODKEY,            Button3,        toggletag,      {0} },
};
3 Likes

Big shout out to guys & gals like you!

Without you … I’m 99% useless. :wink:

GM

2 Likes

My default config.h:

/* appearance */
static const unsigned int borderpx  = 1;        /* border pixel of windows */
static const unsigned int snap      = 32;       /* snap pixel */
static const int swallowfloating    = 1;        /* 1 means swallow floating windows by default */
static const int showbar            = 1;        /* 0 means no bar */
static const int topbar             = 1;        /* 0 means bottom bar */
static const char slopstyle[]       = "-t 0 -c 0.92,0.85,0.69,0.3"; /* do NOT define -f (format) here */
static const char *fonts[]          = {  "siji:pixelsize=18", "UW Ttyp0:pixelsize=14" };
static const char dmenufont[]       = "UW Ttyp0:pixelsize=14";
static const char col_gray1[]       = "#090909";
static const char col_gray2[]       = "#444444";
static const char col_gray3[]       = "#807B7B";
static const char col_gray4[]       = "#eeeeee";
static const char col_cyan[]        = "#082531";
static const char col_cyan2[]       = "#005577";
static const char col_blue1[]       = "#425A57";
static const char col_yellow1[]     = "#6F704B";

static const char *colors[][3]      = {
	/*               fg         bg         border   */
	[SchemeNorm] = { col_gray3, col_gray1, col_gray1 },
	[SchemeSel]  = { col_gray4, col_cyan2,  col_gray3  },
	[SchemeStatus]  = { col_gray3, col_gray1,  "#000000"  }, // Statusbar right {text,background,not used but cannot be empty}
	[SchemeTagsSel]  = { col_gray4, col_gray1,  "#000000"  }, // Tagbar left selected {text,background,not used but cannot be empty}
    [SchemeTagsNorm]  = { col_gray3, col_gray1,  "#000000"  }, // Tagbar left unselected {text,background,not used but cannot be empty}
    [SchemeInfoSel]  = { col_gray4, col_gray1,  "#000000"  }, // infobar middle  selected {text,background,not used but cannot be empty}
    [SchemeInfoNorm]  = { col_gray3, col_gray1,  "#000000"  }, // infobar middle  unselected {text,background,not used but cannot be empty}
};

#include <X11/XF86keysym.h>

static const char *const autostart[] = {
	"slstatus", NULL,
        /* "xcompmgr", "-CcfF", "-I-.015", "-O-.03", "-D1", "-t-1", "-l-3", "-r6.2", "-o.5", NULL, */
        "xset", "r", "rate", "250", "60", NULL,        
        "xset", "-dpms", NULL,
        "xset", "s", "noblank", NULL,
        "xset", "s", "off", NULL,  
        "xset", "+fp", "/usr/share/fonts/misc", NULL, 
        "setroot", "-t", "/home/subjunkie/Walls/death_flower.png", NULL,                                     
        NULL /* terminate */
};

/* tagging */
static const char *tags[] = { "\uE0af₁", "\uE011₂", "\uE1eb₃", "\uE05c₄", "\uE264₅", "\uE1bf₆" };

/* grid of tags */
#define DRAWCLASSICTAGS             1 << 0
#define DRAWTAGGRID                 1 << 1

#define SWITCHTAG_UP                1 << 0
#define SWITCHTAG_DOWN              1 << 1
#define SWITCHTAG_LEFT              1 << 2
#define SWITCHTAG_RIGHT             1 << 3
#define SWITCHTAG_TOGGLETAG         1 << 4
#define SWITCHTAG_TAG               1 << 5
#define SWITCHTAG_VIEW              1 << 6
#define SWITCHTAG_TOGGLEVIEW        1 << 7

static const unsigned int drawtagmask = DRAWCLASSICTAGS; /* | DRAWTAGGRID | DRAWCLASSICTAGS to show classic row of tags */
static const int tagrows = 1;

static const Rule rules[] = {
	/* xprop(1):
	 *	WM_CLASS(STRING) = instance, class
	 *	WM_NAME(STRING) = title
	 */
	/* class     instance  title           tags mask  switchtotag  isfloating  isterminal  noswallow  monitor */
	{ "firefox",  NULL,       NULL,         1 << 5,    1,                     0,            0,            -1,     -1 },
        {  NULL,      NULL,       "cmus",       1 << 3,    1,                    1,            1,            -1,     -1 },
        {  NULL,      NULL,       "noice",      1 << 1,    1,                     0,            1,             0,     -1 },
        {  NULL,      NULL,       "ytfzf",       1 << 2,    1,                      0,            1,             0,     -1 },
        { "sxiv",     NULL,       NULL,          1 >> 3,    0,                      0,            0,            -1,     -1 },  
        { "St",      NULL,     NULL,               0,         0,                            0,            1,             0,     -1 }, 
	{ NULL,      NULL,     "Event Tester", 0,         0,                     0,            0,            -1,     -1 }, /* xev */
};

/* layout(s) */
static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster     = 1;    /* number of clients in master area */
static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */

static const Layout layouts[] = {
	/* symbol     arrange function */
	{ "| \uE002",      tile },    /* first entry is default */
	{ "| \uE006",      NULL },    /* no layout function means floating behavior */
	{ "| \uE000",      monocle },
};

/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },

/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }

/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray4, "-sb", col_yellow1, "-sf", col_gray4, NULL };
static const char *termcmd[]  = { "st", NULL };
static const char *noicecmd[]  = { "st", "-e", "noice", NULL };
static const char *cmuscmd[] = { "st", "-e", "cmus", NULL };
static const char *ytcmd[] = { "st", "-e", "ytfzf", "-D", "-l", NULL };
static const char *mutecmd[] = { "amixer", "-q", "set", "Master", "toggle", NULL };
static const char *volupcmd[] = { "amixer", "-q", "set", "Master", "5%+", "unmute", NULL };
static const char *voldowncmd[] = { "amixer", "-q", "set", "Master", "5%-", "unmute", NULL };

static Key keys[] = {
	/* modifier                     key        function        argument */
	{ 0, XF86XK_AudioMute,          spawn, {.v = mutecmd } },
        { 0, XF86XK_AudioLowerVolume,   spawn, {.v = voldowncmd } },
        { 0, XF86XK_AudioRaiseVolume,   spawn, {.v = volupcmd } },
	{ MODKEY,                       XK_d,      spawn,          {.v = dmenucmd } },
	{ MODKEY,                       XK_Return, spawn,          {.v = termcmd } },
        { MODKEY|ShiftMask,             XK_e,      spawn,          {.v = noicecmd } },
        { MODKEY|ShiftMask,             XK_n,      spawn,          {.v = cmuscmd } },
        { MODKEY,                              XK_y,      spawn,          {.v = ytcmd } },
        { MODKEY,                       XK_Print,  spawn,          {.v = (char *[]){"scrot", NULL}} },
	{ MODKEY|ShiftMask,             XK_Print,  spawn,          {.v = (char *[]){"scrot", "-s", NULL}} },
	{ MODKEY,                       XK_b,      togglebar,      {0} },
	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
	{ MODKEY|ShiftMask,             XK_d,      incnmaster,     {.i = -1 } },
	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
	{ MODKEY|ShiftMask,             XK_Return, zoom,           {0} },
	{ MODKEY,                       XK_Tab,    view,           {0} },
	{ MODKEY,                       XK_q,      killclient,     {0} },
	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
	{ MODKEY,                       XK_space,  setlayout,      {0} },
	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
	TAGKEYS(                        XK_1,                      0)
	TAGKEYS(                        XK_2,                      1)
	TAGKEYS(                        XK_3,                      2)
	TAGKEYS(                        XK_4,                      3)
	TAGKEYS(                        XK_5,                      4)
	TAGKEYS(                        XK_6,                      5)
	TAGKEYS(                        XK_7,                      6)
	TAGKEYS(                        XK_8,                      7)
	TAGKEYS(                        XK_9,                      8)
	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },
	{ MODKEY|ControlMask|ShiftMask, XK_q,      quit,           {1} }, 
	{ MODKEY,                       XK_s,      riodraw,        {0} },

    { MODKEY|ControlMask,           XK_Up,     switchtag,      { .ui = SWITCHTAG_UP     | SWITCHTAG_VIEW } },
    { MODKEY|ControlMask,           XK_Down,   switchtag,      { .ui = SWITCHTAG_DOWN   | SWITCHTAG_VIEW } },
    { MODKEY|ControlMask,           XK_Right,  switchtag,      { .ui = SWITCHTAG_RIGHT  | SWITCHTAG_VIEW } },
    { MODKEY|ControlMask,           XK_Left,   switchtag,      { .ui = SWITCHTAG_LEFT   | SWITCHTAG_VIEW } },

    { MODKEY|Mod4Mask,              XK_Up,     switchtag,      { .ui = SWITCHTAG_UP     | SWITCHTAG_TAG | SWITCHTAG_VIEW } },
    { MODKEY|Mod4Mask,              XK_Down,   switchtag,      { .ui = SWITCHTAG_DOWN   | SWITCHTAG_TAG | SWITCHTAG_VIEW } },
    { MODKEY|Mod4Mask,              XK_Right,  switchtag,      { .ui = SWITCHTAG_RIGHT  | SWITCHTAG_TAG | SWITCHTAG_VIEW } },
    { MODKEY|Mod4Mask,              XK_Left,   switchtag,      { .ui = SWITCHTAG_LEFT   | SWITCHTAG_TAG | SWITCHTAG_VIEW } },
};

/* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
	/* click                event mask      button          function        argument */
	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
	{ ClkTagBar,            0,              Button1,        view,           {0} },
	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
};
2 Likes

My current config.h (for dwm) FWIW.
If anyone wants to see my slstatus or st config.h (just let me know).

/* See LICENSE file for copyright and license details. */

/* appearance */
static const unsigned int borderpx  = 3;        /* border pixel of windows */
static const unsigned int snap      = 34;       /* snap pixel */
static const unsigned int systraypinning = 0;   /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
static const unsigned int systrayspacing = 2;   /* systray spacing */
static const int systraypinningfailfirst = 0;   /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/
static const int showsystray        = 1;     	/* 0 means no systray */
static const int showbar            = 1;        /* 0 means no bar */
static const int topbar             = 1;        /* 0 means bottom bar */
/*static const char *fonts[]        = { "DejaVu Sans Mono:pixelsize=17:antialias=true:autohint=true" };*/
static const char *fonts[]          = { "Hack:pixelsize=17:antialias=true:autohint=true" };
/*static const char *fonts [] 		= { "Mono:pixelsize=17:antialias=true:autohint=true" };*/
static const char dmenufont[]       = "Hack:pixelsize=17";
static const char col_gray1[]       = "#222222";
static const char col_gray2[]       = "#444444";
static const char col_gray3[]       = "#bbbbbb";
static const char col_gray4[]       = "#303643";
static const char col_blue[]        = "#8FBCBB";/* static const char col_cyan[]        = "#005577";*/
static const char *colors[][3]      = {
	/*               fg         bg         border   */
	[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
	[SchemeSel]  = { col_gray4, col_blue,  col_blue  },
};

/* tagging */
static const char *tags[] = {"","","","","","","","","" };
static const Rule rules[] = {
	/* xprop(1):
	 *	WM_CLASS(STRING) = instance, class
	 *	WM_NAME(STRING) = title
	 */
	/* class      				instance    title       tags mask  switchtotag   isfloating   monitor */
	{ "Yad",	     			NULL,     	NULL,       0,            0,			1,           -1 },
	{ "St",     				NULL,     	NULL,       0,            0,			1,           -1 },
	{ "Leafpad",     			NULL,    	NULL,       0,		      1,           	1,			 -1 },
	{ "Termite",     			NULL,     	NULL,       0,            0,			1,           -1 },
	{ "Pamac-manager", 			NULL,       NULL,       1,            1,			0,           -1 },
	{ "Filezilla", 				NULL,       NULL,       1,            1,			1,           -1 },
	{ "luckybackup", 			NULL,       NULL,       1,            1,			1,           -1 },
	{ "Grsync", 				NULL,       NULL,       1,            1,			1,           -1 },
	{ "Mintstick.py",	 		NULL,       NULL,       1,            1,			1,           -1 },
	{ "firefox",  				NULL,       NULL,       2,       	  1,			0,           -1 },
	{ "Vivaldi-stable",			NULL,       NULL,       2,       	  1,			0,           -1 },
	{ "Chromium",  				NULL,       NULL,       2,       	  1,			0,           -1 },
	{ "Thunar",     			NULL,       NULL,   	1 << 2,       1,			0,           -1 },
	{ "Nemo",   				NULL,       NULL,   	1 << 2,       1,			0,           -1 },	
	{ "calibre",     			NULL,    	NULL,       1 << 3,       1,			0,           -1 },
	{ "Xed",	     			NULL,    	NULL,       1 << 3,       0,			1,           -1 },
	{ "VirtualBox Manager", 	NULL,   	NULL,       1 << 4,       0,			0,           -1 },
	{ "Gimp",     				NULL,       NULL,   	1 << 4,       1,			0,           -1 },
	{ "Skype",     				NULL,       NULL,   	1 << 5,       1,			1,           -1 },
	{ "zoom",     				NULL,       NULL,   	1 << 5,       1,			1,			 -1 },
	{ "Pavucontrol",    		NULL,       NULL,   	1 << 6,		  1,			1,           -1 },
	{ "Deadbeef",     			NULL,       NULL,   	1 << 6,       1,			1,           -1 },
	{ "Geany",     				NULL,       NULL,   	1 << 7,       1,			0,           -1 },
	{ "Thunderbird",    		NULL,       NULL,   	1 << 8,       1,			0,           -1 },	
};

/* layout(s) */
static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster     = 1;    /* number of clients in master area */
static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */


static const Layout layouts[] = {
	/* symbol     arrange function */
	{ "[]",     	NULL },
	{ "[]",      	monocle }, /* first entry is default */
	{ "[] ",      	tile },    /* no layout function means floating behavior */
};

/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },

/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }

/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_blue, "-sf", col_gray4, NULL };
static const char *termcmd[]  = { "st", NULL };

static Key keys[] = {
/*    modifier                      key        function        argument          */
	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
	{ MODKEY,			            XK_Return, spawn,          {.v = termcmd } },
	{ MODKEY,                       XK_b,      togglebar,      {0} },
	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
	{ MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
	{ MODKEY|ShiftMask,             XK_Return, zoom,           {0} },
	{ MODKEY,                       XK_Tab,    view,           {0} },
	{ MODKEY|ShiftMask,			    XK_q,      killclient,     {0} },
	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
	{ MODKEY,                       XK_space,  setlayout,      {0} },
	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
	TAGKEYS(                        XK_1,                      0)
	TAGKEYS(                        XK_2,                      1)
	TAGKEYS(                        XK_3,                      2)
	TAGKEYS(                        XK_4,                      3)
	TAGKEYS(                        XK_5,                      4)
	TAGKEYS(                        XK_6,                      5)
	TAGKEYS(                        XK_7,                      6)
	TAGKEYS(                        XK_8,                      7)
	TAGKEYS(                        XK_9,                      8)
	{ MODKEY, 			            XK_q,      	quit,         {0} },
};

/* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
	/* click                event mask      button          function        argument */
	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
	{ ClkTagBar,            0,              Button1,        view,           {0} },
	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
};

Looks very good mate, and I will take advantage of some of your key bindings, specially for the volume/brightness function keys. In my OpenBSD box everything just works out of the box on the thinkpads, but Arch needs just some little tweaks for some function keys.