birdwm

birdwm - mrgrouse's daily driver fork of suckless' dwm. Contains many patches and is currently loosely maintained.
Log | Files | Refs | README | LICENSE

config.def.h (8112B)


      1 /* See LICENSE file for copyright and license details. */
      2 
      3 /* appearance */
      4 static const unsigned int borderpx  = 0;        /* border pixel of windows */
      5 static const unsigned int gappx     = 6;        /* gaps between windows */
      6 static const unsigned int snap      = 32;       /* snap pixel */
      7 static const unsigned int systraypinning = 0;	/* sloppy systray follows selected monitor >0: pin systray to monitor X */
      8 static const unsigned int systrayonleft	= 0;	/* 0: systray in right corner, >0: systray on left of status text */
      9 static const unsigned int systrayspacing = 2;	/* systray spacing */
     10 static const int systraypinningfailfirst = 1;	/* if pinning fails, display systray on the first monitor, False: display systray on last monitor */
     11 static const int showsystray	= 1;		/* 0: no systray */
     12 static const int showbar	= 1;		/* 0 means no bar */
     13 static const int topbar		= 1;		/* 0 means bottom bar */
     14 #define ICONSIZE 16				/* icon size */
     15 #define ICONSPACING 5				/* space between icon and title */
     16 static const int vertpad            = 10;       /* vertical padding of bar */
     17 static const int sidepad            = 10;       /* horizontal padding of bar */
     18 static const char *fonts[]          = { "LexendDeca:pixelsize=18:style=Bold" };
     19 static char normbgcolor[]           = "#222222";
     20 static char normbordercolor[]       = "#444444";
     21 static char normfgcolor[]           = "#bbbbbb";
     22 static char selfgcolor[]            = "#eeeeee";
     23 static char selbordercolor[]        = "#005577";
     24 static char selbgcolor[]            = "#005577";
     25 static char *colors[][3] = {
     26        /*               fg           bg           border   */
     27        [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
     28        [SchemeSel]  = { selfgcolor,  selbgcolor,  selbordercolor  },
     29 };
     30 
     31 static const char *const autostart[] = {
     32 	"pipewire", NULL,
     33 	"wireplumber", NULL,
     34 	"gnome-keyring-daemon", "-f", NULL,
     35 	"picom", NULL,
     36 	"slstatus", NULL,
     37 	"syncthing", "--no-browser", NULL,
     38 	"mpd", "--no-daemon", NULL,
     39 	NULL /* terminate */
     40 };
     41 
     42 /* tagging */
     43 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
     44 
     45 static const Rule rules[] = {
     46 	/* xprop(1):
     47 	 *	WM_CLASS(STRING) = instance, class
     48 	 *	WM_NAME(STRING) = title
     49 	 */
     50 	/* class      instance    title       tags mask     isfloating   monitor */
     51 	{ "Gimp",     NULL,       NULL,       0,            1,           -1 },
     52 	{ "Firefox",  NULL,       NULL,       1 << 8,       0,           -1 },
     53 	{ "vesktop",  "vesktop",  NULL,	      1 << 4,	    0,		 -1 },
     54 	{ "tutanota-desktop", "tutanota-desktop", NULL, 1 << 5, 0,	 -1 },
     55 	{ "Signal",   "signal",   NULL,	      1 << 2,	    0,		 -1 },
     56 };
     57 
     58 /* layout(s) */
     59 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
     60 static const int nmaster     = 1;    /* number of clients in master area */
     61 static const int resizehints = 0;    /* 1 means respect size hints in tiled resizals */
     62 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
     63 
     64 static const Layout layouts[] = {
     65 	/* symbol     arrange function */
     66 	{ "[]=",      tile },    /* first entry is default */
     67 	{ "><>",      NULL },    /* no layout function means floating behavior */
     68 	{ "[M]",      monocle },
     69 };
     70 
     71 /* key definitions */
     72 #define MODKEY Mod1Mask
     73 #define TAGKEYS(KEY,TAG) \
     74 	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
     75 	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
     76 	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
     77 	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
     78 
     79 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
     80 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
     81 
     82 /* commands */
     83 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
     84 static const char *dmenucmd[] = { "birdmenu_run", "-i", NULL };
     85 static const char *termcmd[]  = { "birdterm", NULL };
     86 static const char *wallpaper[] = { "nsxiv", "-t", WALLPAPERDIR, NULL };
     87 static const char *passman[] = { "kpmenu", NULL };
     88 static const char scratchpadname[] = "scratchpad";
     89 static const char *scratchpadcmd[] = { "birdterm", "-t", scratchpadname, "-g", "120x34", NULL };
     90 
     91 static const Key keys[] = {
     92 	/* modifier                     key        function        argument */
     93 	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
     94 	{ MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
     95 	{ MODKEY,			XK_w,	   spawn,          {.v = wallpaper } },
     96 	{ MODKEY,			XK_k,	   spawn,          {.v = passman } },
     97 	{ MODKEY,                       XK_y,  togglescratch,  {.v = scratchpadcmd } },
     98 	{ MODKEY,                       XK_b,      togglebar,      {0} },
     99 	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
    100 	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
    101 	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
    102 	{ MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
    103 	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
    104 	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
    105 	{ MODKEY,                       XK_Return, zoom,           {0} },
    106 	{ MODKEY,                       XK_Tab,    view,           {0} },
    107 	{ MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
    108 	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
    109 	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
    110 	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
    111 	{ MODKEY,                       XK_space,  setlayout,      {0} },
    112 	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
    113 	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
    114 	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
    115 	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
    116 	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
    117 	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
    118 	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
    119 	{ MODKEY,                       XK_o,     xrdb,           {.v = NULL } },
    120 	TAGKEYS(                        XK_1,                      0)
    121 	TAGKEYS(                        XK_2,                      1)
    122 	TAGKEYS(                        XK_3,                      2)
    123 	TAGKEYS(                        XK_4,                      3)
    124 	TAGKEYS(                        XK_5,                      4)
    125 	TAGKEYS(                        XK_6,                      5)
    126 	TAGKEYS(                        XK_7,                      6)
    127 	TAGKEYS(                        XK_8,                      7)
    128 	TAGKEYS(                        XK_9,                      8)
    129 	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },
    130 };
    131 
    132 /* button definitions */
    133 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    134 static const Button buttons[] = {
    135 	/* click                event mask      button          function        argument */
    136 	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    137 	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    138 	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
    139 	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
    140 	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    141 	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    142 	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
    143 	{ ClkTagBar,            0,              Button1,        view,           {0} },
    144 	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
    145 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    146 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
    147 };
    148