Advertisement
xathrya

DWM

Feb 11th, 2017
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 6.70 KB | None | 0 0
  1. /* See LICENSE file for copyright and license details. */
  2.  
  3. /**
  4.  * dracOs DWM (Dynamic Window Manager) configuration
  5.  * custom DWM for dracOs
  6.  *
  7.  * Xathrya    (2017) <xathrya@dracos-linux.org>
  8.  * Randalltux (2016) <rndtx@dracos-linux.org>
  9.  */
  10.  
  11. /* appearance */
  12. static const char colors[SchemeLast][3][8] = {
  13. //     border    foreground   background
  14.    { "#C5C8C6", "#C5C8C6", "#000000" },  // 1 = normal empty
  15.    { "#515151", "#6e6e6e", "#000000" },  // 2 = selected
  16.    { "#000000", "#C5C8C6", "#000000" },  // 3 = Occupied tag
  17.    { "#000000", "#7a7a7a", "#C5C8C6" },  // 4 = Layoutbar
  18.    { "#000000", "#6e6e6e", "#000000" },  // 5 = Titlebar
  19.    { "#000000", "#C5C8C6", "#C5C8C6" },  // 6 = Status Text
  20.    { "#000000", "#C5C8C6", "#C5C8C6" },  // 7 = Status Icon
  21. };
  22.  
  23. #define CLR_NORMAL       0
  24. #define CLR_SELECT       1
  25. #define CLR_OCCUPIED     2
  26. #define CLR_LAYOUTBAR    3
  27. #define CLR_TITLEBAR     4
  28. #define CLR_STATTEXT     5
  29. #define CLR_STATICON     5
  30.  
  31. #define SCH_BORDER       0
  32. #define SCH_FG           1
  33. #define SCH_BG           2
  34.  
  35. static const char *fonts[] = {
  36.     "drift:size=10"
  37. };
  38. static const unsigned int borderpx  = 1;        // Window Border width
  39. static const unsigned int snap      = 11;       // Window Snap
  40. static const unsigned int barpadding= 11;       // Bar vertical Padding
  41. static const unsigned int gappx     = 1;        // gap pixel between windows
  42. static const int showbar            = 1;        /* 0 means no bar */
  43. static const int topbar             = 1;        /* 0 means bottom bar */
  44. static const int secondbar          = 1;        /* 0 means no extra bar */
  45. static const unsigned int marginbottom  = 0;
  46.  
  47. /* tagging */
  48. static const char *tags[] = { "  MAIN  ", "  DEVEL  ", "  PENTEST  ","  MISC  "};
  49.  
  50. static const Rule rules[] = {
  51.     /* xprop(1):
  52.      *  WM_CLASS(STRING) = instance, class
  53.      *  WM_NAME(STRING) = title
  54.      */
  55.      /* class      instance    title     tags mask    iscentered     isfloating   monitor */
  56.      { "Gcolor2",  NULL,       NULL,     0,           0,             1,        -1 },
  57.      { "feh",      NULL,       NULL,     0,           0,             1,        -1 },
  58.      { "XClock",   NULL,       NULL,     0,           0,             1,        -1 },
  59. };
  60.  
  61. /* layout(s) */
  62. static const float mfact     = 0.50; /* factor of master area size [0.05..0.95] */
  63. static const int nmaster     = 1;    /* number of clients in master area */
  64. static const int resizehints = 0;    /* 1 means respect size hints in tiled resizals */
  65.  
  66. // Layout Icons
  67. static const Layout layouts[] = {
  68. //     Symbol      Layout
  69.     { " ù ",       NULL           },    // ><>
  70.     { " ø ",       tile           },    // []=
  71.     { " ú ",       monocle        },    // [M]
  72.     { " ð ",       gaplessgrid    },    
  73.     { " ã ",       bstack         },    // TTT
  74.     { " ü ",       deck           },    
  75.     { " Î ",       col            },    // |||
  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 const char *termcmd[]    = { "urxvt", "-name", "Console", NULL };
  91. static const char *filecmd[]    = { "urxvt", "-name", "FileManager", "-e", "ranger", NULL };
  92. static const char *webcmd[]     = { "links", "-g", NULL };
  93. static const char *w3m[]        = { "w3m", NULL };
  94. static const char *dracosmenu[] = { "dmenu", "~/.script/dracosmenu", NULL };
  95. static const char *scrotcmd[]   = { "scrot", NULL };
  96.  
  97. static Key keys[] = {
  98.     /* modifier             key         function            argument */
  99.     {                0,     XK_Print,   spawn,              {.v = scrotcmd } },
  100.     { MODKEY|ShiftMask,     XK_Return,  spawn,              {.v = termcmd } },
  101.     { MODKEY|ShiftMask,     XK_d,       spawn,              {.v = dracosmenu } },
  102.     { MODKEY|ShiftMask,     XK_t,       spawn,              {.v = filecmd } },
  103.     { MODKEY|ShiftMask,     XK_l,       spawn,              {.v = webcmd } },
  104.     { MODKEY|ShiftMask,     XK_w,       spawn,              {.v = w3m } },
  105.     { MODKEY,               XK_f,       setlayout,          {.v = &layouts[0]} },
  106.     { MODKEY,               XK_t,       setlayout,          {.v = &layouts[1]} },
  107.     { MODKEY,               XK_m,       setlayout,          {.v = &layouts[2]} },
  108.     { MODKEY,               XK_g,       setlayout,          {.v = &layouts[3]} },
  109.     { MODKEY,               XK_s,       setlayout,          {.v = &layouts[4]} },
  110.     { MODKEY,               XK_o,       setlayout,          {.v = &layouts[5]} },
  111.     { MODKEY,               XK_c,       setlayout,          {.v = &layouts[6]} },
  112.     { MODKEY,               XK_equal,   incnmaster,         {.i = -1 } },
  113.     { MODKEY,               XK_minus,   incnmaster,         {.i = +1 } },
  114.     { MODKEY,               XK_Return,  zoom,               {0} },
  115.     { MODKEY,               XK_h,       setmfact,           {.f = -0.02} },
  116.     { MODKEY,               XK_l,       setmfact,           {.f = +0.02} },
  117.     { MODKEY,               XK_space,   togglefloating,     {0} },
  118.     { MODKEY,               XK_b,       togglebar,          {0} },
  119.     { MODKEY,               XK_b,       togglesecondbar,     {0} },
  120.     { MODKEY,               XK_Tab,     focusstack,         {.i = +1 } },
  121.     { MODKEY|ShiftMask,     XK_c,       killclient,         {0} },
  122.     { MODKEY,               XK_Left,    cycle,              {.i = -1} },
  123.     { MODKEY,               XK_Right,   cycle,              {.i = +1} },
  124.     { MODKEY|ShiftMask,     XK_Left,    tagcycle,           {.i = -1} },
  125.     { MODKEY|ShiftMask,     XK_Right,   tagcycle,           {.i = +1} },
  126.     TAGKEYS(                XK_1,                            0)
  127.     TAGKEYS(                XK_2,                            1)
  128.     TAGKEYS(                XK_3,                            2)
  129.     TAGKEYS(                XK_4,                            3)
  130.     { MODKEY|ShiftMask,     XK_r,       restart,            {0} },
  131.     { MODKEY|ShiftMask,     XK_q,       quit,               {1} },
  132. };
  133.  
  134. /* button definitions */
  135. /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  136. static Button buttons[] = {
  137.     /* click                event mask      button          function        argument */
  138.     { ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
  139.     { ClkTagBar,            0,              Button1,        view,           {0} },
  140.     { ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
  141.     { ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
  142. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement