dotfiles

My dotfiles for Arch Linux
git clone git://git.janispagel.de/dotfiles.git
Log | Files | Refs | README

config.h (8962B)


      1 /* See LICENSE file for copyright and license details. */
      2 
      3 /* Enable multimedia keys */
      4 #include <X11/XF86keysym.h>
      5 
      6 /* appearance */
      7 static const unsigned int borderpx  = 3;        /* border pixel of windows */
      8 static const unsigned int snap      = 32;       /* snap pixel */
      9 static const int showtitle          = 0;        /* 0 means no title */
     10 static const int showbar            = 1;        /* 0 means no bar */
     11 static const int topbar             = 1;        /* 0 means bottom bar */
     12 static const char *fonts[]          = { "Sans:size=11" };
     13 static const char dmenufont[]       = "Sans:size=12";
     14 static const char dmenuln[]         = "20";
     15 /* Default colors
     16 static const char col_gray1[]       = "#222222";
     17 static const char col_gray2[]       = "#444444";
     18 static const char col_gray3[]       = "#bbbbbb";
     19 static const char col_gray4[]       = "#eeeeee";
     20 static const char col_cyan[]        = "#005577";
     21 */
     22 /* Nord colors */
     23 static const char col_gray1[]       = "#2e3440"; /* nord0 */
     24 static const char col_gray3[]       = "#eceff4"; /* nord6 */
     25 static const char col_gray4[]       = "#e5e9f0"; /* nord5 */
     26 static const char col_cyan[]        = "#5e81ac"; /* nord10 */
     27 static const char col_gray2[]       = "#81a1c1"; /* nord9 */
     28 static const char col_red[]         = "#bf616a"; /* nord11 */
     29 static const char col_yellow[]      = "#ebcb8b"; /* nord13 */
     30 static const char *colors[][3]      = {
     31 	/*               fg         bg         border   */
     32 	[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
     33 	[SchemeSel]  = { col_gray4, col_cyan,  col_yellow  },
     34 };
     35 
     36 /* tagging */
     37 static const char *tags[] = { "", "", "", "", "", "", "⏯", "", "🌍" };
     38 
     39 static const Rule rules[] = {
     40 	/* xprop(1):
     41 	 *	WM_CLASS(STRING) = instance, class
     42 	 *	WM_NAME(STRING) = title
     43 	 */
     44 	/* class         instance          title               tags mask     isfloating   monitor */
     45 	{ "Gimp",           NULL,          NULL,               0,            1,           -1 },
     46 	{ NULL,             NULL,          "wifi",             0,            1,           -1 },
     47 	{ "MEGAsync",       NULL,          NULL,               1,            1,           -1 },
     48 	{ "de-unistuttgart-ims-coref-annotator-Annotator", NULL, NULL, 1<<2, 1,           -1 },
     49 	{ "Geany",          NULL,          NULL,               1<<2,         0,           -1 },
     50 	{ "RStudio",        NULL,          NULL,               1<<2,         0,           -1 },
     51 	{ "Eclipse",        NULL,          NULL,               1<<2,         0,           -1 },
     52 	{ NULL,             NULL,          "top",              1<<4,         0,           -1 },
     53 	{ "Skype",          NULL,          NULL,               1<<5,         0,           -1 },
     54 	{ NULL,             "mpv-youtube", NULL,               1<<6,         0,           -1 },
     55 	{ NULL,             NULL,          "mpv-youtube.bash", 1<<6,         0,           -1 },
     56 	{ NULL,             NULL,          "youtube-viewer",   1<<6,         0,           -1 },
     57 	{ NULL,             NULL,          "mpsyt",            1<<6,         0,           -1 },
     58 	{ "Thunderbird",    NULL,          NULL,               1<<7,         0,           -1 },
     59 	{ NULL,             NULL,          "mutt",             1<<7,         0,           -1 },
     60 	{ "Firefox",        NULL,          NULL,               1<<8,         0,           -1 },
     61         { "Nightly",        NULL,          NULL,               1<<8,         0,           -1 },
     62 	{ "qutebrowser",    NULL,          NULL,               1<<8,         0,           -1 },
     63 	{ NULL,             "surf",        NULL,               1<<8,         0,           -1 },
     64 };
     65 
     66 /* layout(s) */
     67 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
     68 static const int nmaster     = 1;    /* number of clients in master area */
     69 static const int resizehints = 0;    /* 1 means respect size hints in tiled resizals */
     70 
     71 static const Layout layouts[] = {
     72 	/* symbol     arrange function */
     73 	{ "[]=",      tile },    /* first entry is default */
     74 	{ "[M]",      monocle },
     75 	{ "><>",      NULL },    /* no layout function means floating behavior */
     76 };
     77 
     78 /* key definitions */
     79 #define MODKEY Mod4Mask
     80 #define TAGKEYS(KEY,TAG) \
     81 	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
     82 	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
     83 	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
     84 	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
     85 
     86 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
     87 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
     88 
     89 /* commands */
     90 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
     91 static const char *dmenucmd[] = { "dmenu_run", "-c", "-p", "Run:", "-l", dmenuln, "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
     92 static const char *termcmd[]  = { "st", NULL };
     93 static const char scratchpadname[] = "scratchpad";
     94 static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34", "-e", "/bin/tmux", "new", "-s", "scratchpad", NULL };
     95 
     96 static Key keys[] = {
     97 	/* modifier                     key        function        argument */
     98 	{ MODKEY,                       XK_d,      spawn,          {.v = dmenucmd } },
     99 	{ MODKEY,             		XK_Return, spawn,          {.v = termcmd } },
    100 	{ Mod1Mask,                     XK_s,      togglescratch,  {.v = scratchpadcmd } },
    101 	{ MODKEY,                       XK_x,      togglebar,      {0} },
    102 	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
    103 	{ MODKEY,                       XK_Left,   focusstack,     {.i = +1 } },
    104 	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
    105         { MODKEY,                       XK_Right,  focusstack,     {.i = -1 } },
    106 	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
    107 	{ MODKEY,                       XK_s,      incnmaster,     {.i = -1 } },
    108 	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
    109 	{ MODKEY,                       XK_g,      setmfact,       {.f = +0.05} },
    110 	{ MODKEY,                       XK_z,      zoom,           {0} },
    111 	{ MODKEY,                       XK_Tab,    view,           {0} },
    112 	{ MODKEY|ShiftMask,             XK_q,      killclient,     {0} },
    113 	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
    114 	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[2]} },
    115 	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[1]} },
    116 	{ MODKEY,                       XK_space,  setlayout,      {0} },
    117 	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
    118 	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
    119 	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
    120 	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
    121 	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
    122 	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
    123 	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
    124 	TAGKEYS(                        XK_1,                      0)
    125 	TAGKEYS(                        XK_2,                      1)
    126 	TAGKEYS(                        XK_3,                      2)
    127 	TAGKEYS(                        XK_4,                      3)
    128 	TAGKEYS(                        XK_5,                      4)
    129 	TAGKEYS(                        XK_6,                      5)
    130 	TAGKEYS(                        XK_7,                      6)
    131 	TAGKEYS(                        XK_8,                      7)
    132 	TAGKEYS(                        XK_9,                      8)
    133 	{ MODKEY|ShiftMask,             XK_e,      quit,           {0} },
    134 };
    135 
    136 /* button definitions */
    137 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    138 static Button buttons[] = {
    139 	/* click                event mask      button          function        argument */
    140 	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    141 	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    142 	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
    143 	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
    144 	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    145 	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    146 	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
    147 	{ ClkTagBar,            0,              Button1,        view,           {0} },
    148 	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
    149 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    150 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
    151 };
    152