dotfiles

config files for my linux setup
git clone git://edryd.org/dotfiles
Log | Files | Refs | README

dwm.h (8608B)


      1 /* See LICENSE file for copyright and license details. */
      2 
      3 /* appearance */
      4 static const char *fonts[] = {
      5 	"FantasqueSansMono-Regular:pixelsize=18",
      6 	"FontAwesome:pixelsize=14"
      7 };
      8 static const char dmenufont[]       = "monospace:size=10";
      9 static const char *colors[][3]      = {
     10 	/*               fg         bg         border   */
     11 	[SchemeNorm] = { "#93A1A1", "#073642", "#002b36" },
     12 	[SchemeSel]  = { "#eee8d5", "#268bd2",  "#268bd2" },
     13 };
     14 static const char urgbordercolor[]  = "#dc322f";
     15 static const unsigned int borderpx  = 1;         /* border pixel of windows */
     16 static const unsigned int gappx     = 6;         /* gap pixel between windows */
     17 static const unsigned int snap      = 32;        /* snap pixel */
     18 static const unsigned int systraypinning = 0;    /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
     19 static const unsigned int systrayspacing = 2;    /* systray spacing */
     20 static const int systraypinningfailfirst = 1;    /* 1: if pinning fails, display systray on the first monitor, 0: display systray on the last monitor*/
     21 static const int showsystray        = 1;         /* 0 means no systray */
     22 static const int showbar            = 1;         /* 0 means no bar */
     23 static const int topbar             = 1;         /* 0 means bottom bar */
     24 
     25 /* tagging */
     26 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
     27 
     28 static const Rule rules[] = {
     29 	/* class      instance    title       tags mask     isfloating   monitor */
     30 	{  NULL,      NULL,      "bar",       0,            1,           -1 },
     31 };
     32 
     33 /* layout(s) */
     34 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
     35 static const int nmaster     = 1;    /* number of clients in master area */
     36 static const int resizehints = 0;    /* 1 means respect size hints in tiled resizals */
     37 
     38 #include "htile.c"
     39 #include "deck.c"
     40 #include "centered.c"
     41 #include "fibonacci.c"
     42 #include "gaplessgrid.c"
     43 #include "horizgrid.c"
     44 #include "tcl.c"
     45 static const Layout layouts[] = {
     46 	/* symbol   arrange function */
     47 	{ "[]=",    tile        },
     48 	{ "><>",    NULL        }, /* floating */
     49 	{ "[+]",    htile       },
     50 	{ "D  ",    deck        },
     51 	{ "[o]",    centered    },
     52 	{ "[@]",    spiral      },
     53 	{ "[\\]",   dwindle     },
     54 	{ "###",    gaplessgrid },
     55 	{ "###",    horizgrid   },
     56 	{ "|||",    tcl         },
     57 	{ "[M]",    monocle     },
     58 };
     59 
     60 /* key definitions */
     61 #define MODKEY Mod4Mask
     62 #define TAGKEYS(KEY,TAG) \
     63 	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
     64 	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
     65 	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
     66 	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
     67 
     68 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
     69 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
     70 
     71 /* commands */
     72 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
     73 static const char *dmenucmd[] = { "menu.sh", NULL };
     74 static const char *termcmd[]  = { "tabbed", "-c", "st", "-w", NULL };
     75 static const char *calcmd[]   = { "gsimplecal", NULL };
     76 
     77 #include "shiftview.c"
     78 #include "push.c"
     79 #include "zoomswap.c"
     80 #include "switchcol.c"
     81 static Key keys[] = {
     82 	/* modifier                     key        function        argument */
     83 	{ MODKEY,                       XK_t,      spawn,          {.v = termcmd  } },
     84 	{ MODKEY,                       XK_b,      togglebar,      {0} },
     85 
     86 	{ MODKEY,                       XK_l,      focusstack,     {.i = +1 } },
     87 	{ MODKEY,                       XK_h,      focusstack,     {.i = -1 } },
     88 	{ MODKEY|ShiftMask,             XK_l,      pushdown,       {0} },
     89 	{ MODKEY|ShiftMask,             XK_h,      pushup,         {0} },
     90 	{ MODKEY|Mod1Mask,              XK_l,      shiftview,      {.i = +1 } },
     91 	{ MODKEY|Mod1Mask,              XK_h,      shiftview,      {.i = -1 } },
     92 	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
     93 	{ MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
     94 	{ MODKEY,                       XK_j,      setmfact,       {.f = -0.05} },
     95 	{ MODKEY,                       XK_k,      setmfact,       {.f = +0.05} },
     96 	{ MODKEY|ShiftMask,             XK_j,      setcfact,       {.f = +0.25} },
     97 	{ MODKEY|ShiftMask,             XK_k,      setcfact,       {.f = -0.25} },
     98 	{ MODKEY|ShiftMask,             XK_o,      setcfact,       {.f =  0.00} },
     99 
    100 	{ MODKEY,                       XK_Return, switchcol,      {0} },
    101 	{ MODKEY|ShiftMask,             XK_Return, zoomswap,       {0} },
    102 	{ MODKEY,                       XK_Tab,    view,           {0} },
    103 
    104 	{ MODKEY|ControlMask,           XK_t,      setlayout,      {.v = &layouts[0]} },
    105 	{ MODKEY|ControlMask,           XK_f,      setlayout,      {.v = &layouts[1]} },
    106 	{ MODKEY|ControlMask,           XK_h,      setlayout,      {.v = &layouts[2]} },
    107 	{ MODKEY|ControlMask,           XK_d,      setlayout,      {.v = &layouts[3]} },
    108 	{ MODKEY|ControlMask,           XK_c,      setlayout,      {.v = &layouts[4]} },
    109 	{ MODKEY|ControlMask,           XK_s,      setlayout,      {.v = &layouts[5]} },
    110 	{ MODKEY|ControlMask|ShiftMask, XK_s,      setlayout,      {.v = &layouts[6]} },
    111 	{ MODKEY|ControlMask,           XK_g,      setlayout,      {.v = &layouts[7]} },
    112 	{ MODKEY|ControlMask|ShiftMask, XK_g,      setlayout,      {.v = &layouts[8]} },
    113 	{ MODKEY|ControlMask,           XK_r,      setlayout,      {.v = &layouts[9]} },
    114 	{ MODKEY|ControlMask,           XK_m,      setlayout,      {.v = &layouts[10]} },
    115 	{ MODKEY,                       XK_space,  setlayout,      {0} },
    116 
    117 	{ Mod1Mask,                     XK_space,  togglefloating, {0} },
    118 	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
    119 	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
    120 
    121 	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
    122 	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
    123 	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
    124 	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
    125 	TAGKEYS(                        XK_1,                      0)
    126 	TAGKEYS(                        XK_2,                      1)
    127 	TAGKEYS(                        XK_3,                      2)
    128 	TAGKEYS(                        XK_4,                      3)
    129 	TAGKEYS(                        XK_5,                      4)
    130 	TAGKEYS(                        XK_6,                      5)
    131 	TAGKEYS(                        XK_7,                      6)
    132 	TAGKEYS(                        XK_8,                      7)
    133 	TAGKEYS(                        XK_9,                      8)
    134 	{ MODKEY|ShiftMask,             XK_x,      killclient,     {0} },
    135 	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },
    136 };
    137 
    138 /* button definitions */
    139 /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    140 static Button buttons[] = {
    141 	/* click                event mask      button          function        argument */
    142 	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    143 	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    144 	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
    145 	{ ClkStatusText,        0,              Button1,        spawn,          {.v = calcmd } },
    146 	{ ClkClientWin,         Mod1Mask,       Button1,        movemouse,      {0} },
    147 	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    148 	{ ClkClientWin,         Mod1Mask,       Button3,        resizemouse,    {0} },
    149 	{ ClkTagBar,            0,              Button1,        view,           {0} },
    150 	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
    151 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    152 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
    153 };
    154 
    155 #define NUMCOLORS 8
    156 static const char colors[NUMCOLORS][MAXCOLORS][8] = {
    157   // border    fg         bg
    158   { "#002b36", "#93A1A1", "#073642" },  // normal
    159   { "#268bd2", "#eee8d5", "#268bd2" },  // selected
    160   { "#002b36", "#b58900", "#073642" },  // yellow
    161   { "#002b36", "#cb4b16", "#073642" },  // orange
    162   { "#002b36", "#dc322f", "#073642" },  // red
    163   { "#002b36", "#d33682", "#073642" },  // pink
    164   { "#002b36", "#6c71c4", "#073642" },  // violet
    165   /* { "#002b36", "#268bd2", "#073642" },  // blue */
    166   /* { "#002b36", "#2aa198", "#073642" },  // cyan */
    167   { "#002b36", "#859900", "#073642" }  // green
    168 };