Advertisement
Guest User

config.h

a guest
Jul 26th, 2012
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 7.51 KB | None | 0 0
  1. /* See LICENSE file for copyright and license details. */
  2.  
  3. /* appearance */
  4. static const char font[]            = "-*-terminus-medium-r-*-*-12-*-*-*-*-*-*-*";
  5. static const char normbordercolor[] = "#222222";
  6. static const char normbgcolor[]     = "#121212";
  7. static const char normfgcolor[]     = "#898989";
  8. static const char selbordercolor[]  = "#555555";
  9. static const char selbgcolor[]      = "#333333";
  10. static const char selfgcolor[]      = "#dcdcdc";
  11. static const unsigned int borderpx  = 1;        /* border pixel of windows */
  12. static const unsigned int snap      = 32;       /* snap pixel */
  13. static const Bool showbar           = True;     /* False means no bar */
  14. static const Bool topbar            = True;     /* False means bottom bar */
  15. static const unsigned int systrayspacing = 2;   /* systray spacing */
  16. static const Bool showsystray       = True;     /* False means no systray */
  17.  
  18. /* tagging */
  19. static const char *tags[] = { "1", "2", "3", "4", "5", "6" };
  20.  
  21. static const Rule rules[] = {
  22.     /* class      instance    title       tags mask     isfloating   monitor */
  23.     { "Gimp",     NULL,       NULL,       0,            True,        -1 },
  24. //  { "Firefox",  NULL,       NULL,       1 << 8,       False,       -1 },
  25. };
  26.  
  27. /* layout(s) */
  28. static const float mfact      = 0.55; /* factor of master area size [0.05..0.95] */
  29. static const int nmaster      = 1;    /* number of clients in master area */
  30. static const Bool resizehints = False; /* True means respect size hints in tiled resizals */
  31.  
  32. #include "layouts/bstack.c"
  33. #include "layouts/bstackhoriz.c"
  34. #include "layouts/gaplessgrid.c"
  35. #include "layouts/grid.c"
  36. static const Layout layouts[] = {
  37.     /* symbol     arrange function */
  38.     { "[]=",   tile },    /* first entry is default */
  39.     { "[F]",   NULL },    /* no layout function means floating behavior */
  40.     { "[M]",   monocle },
  41.     { "TTT",   bstack },
  42.     { "===", bstackhoriz },
  43.     { "###",   gaplessgrid },
  44.     { "HHH", grid },
  45. };
  46. #include "other/push.c"
  47. /* key definitions */
  48. #define MODKEY Mod1Mask
  49. #define TAGKEYS(KEY,TAG) \
  50.     { MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
  51.     { MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
  52.     { MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
  53.     { MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
  54. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  55. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  56.  
  57. /* commands */
  58. static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, "-b", NULL };
  59. static const char *termcmd[] = { "urxvt", NULL };
  60. static const char *vimcmd[] = { "urxvt", "-e", "vim", NULL };
  61. static const char *imcmd[] = { "pidgin", NULL };
  62. static const char *mpdpausecmd[] = { "ncmpcpp", "pause", NULL };
  63. static const char *mpdplaycmd[] = { "ncmpcpp", "play", NULL };
  64. static const char *mpdprevcmd[] = { "ncmpcpp", "prev", NULL };
  65. static const char *mpdnextcmd[] = { "ncmpcpp", "next", NULL };
  66.  
  67. static Key keys[] = {
  68.     /* modifier                     key        function        argument */
  69.     { MODKEY,                       XK_F12,    spawn,          {.v = termcmd } },
  70.     { MODKEY,                       XK_F7,     spawn,          {.v = imcmd } },
  71.     { MODKEY,                       XK_F5,     spawn,          {.v = vimcmd } },
  72.     { MODKEY|ShiftMask,             XK_o,      spawn,          {.v = mpdpausecmd } },
  73.     { MODKEY|ShiftMask,             XK_i,      spawn,          {.v = mpdplaycmd } },
  74.     { MODKEY|ShiftMask,             XK_p,      spawn,          {.v = mpdprevcmd } },
  75.     { MODKEY|ShiftMask,             XK_n,      spawn,          {.v = mpdnextcmd } },
  76.     { MODKEY,                       XK_p,    spawn,            {.v = dmenucmd } },
  77.     { MODKEY|ControlMask,           XK_j,      pushdown,       {0} },
  78.     { MODKEY|ControlMask,           XK_k,      pushup,         {0} },
  79.     { MODKEY,                       XK_b,      togglebar,      {0} },
  80.     { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
  81.     { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
  82.     { MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
  83.     { MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
  84.     { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
  85.     { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
  86.     { MODKEY,                       XK_Return, zoom,           {0} },
  87.     { MODKEY,                       XK_Tab,    view,           {0} },
  88.     { MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
  89.     { MODKEY|ShiftMask,             XK_t,       setlayout,     {.v = &layouts[0]} }, /* tile */
  90.     { MODKEY|ShiftMask,             XK_f,       setlayout,     {.v = &layouts[1]} }, /* float */
  91.     { MODKEY|ShiftMask,             XK_m,       setlayout,     {.v = &layouts[2]} }, /* monocle */
  92.     { MODKEY|ShiftMask,             XK_b,       setlayout,     {.v = &layouts[3]} }, /* bottomstack */
  93.     { MODKEY|ShiftMask,             XK_g,       setlayout,     {.v = &layouts[5]} }, /* gaplessgrid */
  94.     { MODKEY|ShiftMask,             XK_r,       setlayout,     {.v = &layouts[6]} }, /* grid */
  95.     { MODKEY|ShiftMask,             XK_z,       setlayout,     {.v = &layouts[4]} }, /* bstackhoriz */
  96.     { MODKEY,                       XK_space,  setlayout,      {0} },
  97.     { MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
  98.     { MODKEY,                       XK_0,      view,           {.ui = ~0 } },
  99.     { MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
  100.     { MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
  101.     { MODKEY,                       XK_period, focusmon,       {.i = +1 } },
  102.     { MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
  103.     { MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
  104.     TAGKEYS(                        XK_1,                      0)
  105.     TAGKEYS(                        XK_2,                      1)
  106.     TAGKEYS(                        XK_3,                      2)
  107.     TAGKEYS(                        XK_4,                      3)
  108.     TAGKEYS(                        XK_5,                      4)
  109.     TAGKEYS(                        XK_6,                      5)
  110.     TAGKEYS(                        XK_7,                      6)
  111.     TAGKEYS(                        XK_8,                      7)
  112.     TAGKEYS(                        XK_9,                      8)
  113.     { MODKEY|ShiftMask,             XK_q,      quit,           {0} },
  114. };
  115.  
  116. /* button definitions */
  117. /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  118. static Button buttons[] = {
  119.     /* click                event mask      button          function        argument */
  120.     { ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
  121.     { ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
  122.     { ClkWinTitle,          0,              Button2,        zoom,           {0} },
  123.     { ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
  124.     { ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
  125.     { ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
  126.     { ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
  127.     { ClkTagBar,            0,              Button1,        view,           {0} },
  128.     { ClkTagBar,            0,              Button3,        toggleview,     {0} },
  129.     { ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
  130.     { ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
  131. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement