Advertisement
Guest User

Untitled

a guest
Oct 13th, 2012
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 7.75 KB | None | 0 0
  1. /* See LICENSE file for copyright and license details. */
  2.  
  3. /* appearance */
  4. static const char font[]            = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";
  5. static const char normbordercolor[] = "#444444";
  6. static const char normbgcolor[]     = "#222222";
  7. static const char normfgcolor[]     = "#bbbbbb";
  8. static const char selbordercolor[]  = "#005577";
  9. static const char selbgcolor[]      = "#005577";
  10. static const char selfgcolor[]      = "#eeeeee";
  11. static const unsigned int borderpx  = 1;        /* border pixel of windows */
  12. static const unsigned int snap      = 32;       /* snap pixel */
  13. static const unsigned int systrayspacing = 2;   /* systray spacing */
  14. static const Bool showsystray       = True;     /* False means no systray */
  15. static const Bool showbar           = True;     /* False means no bar */
  16. static const Bool topbar            = True;     /* False means bottom bar */
  17.  
  18. /* tagging */
  19. //static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
  20. static const char *tags[] = { "main", "term", "www", "im", "email", "skype", "mocp", "video", "VBox" };
  21.  
  22. //static const Rule rules[] = {
  23. /* class      instance    title       tags mask     isfloating   monitor */
  24. //  { "Gimp",     NULL,       NULL,       0,            True,        -1 },
  25. //  { "Firefox",  NULL,       NULL,       1 << 8,       False,       -1 },
  26. //};
  27.  
  28. static const Rule rules[] = {
  29.     /* class:instance:title regex   tags regex      isfloating */
  30.     { "Gimp",           NULL,   NULL,   0,      True,   -1 },
  31.     { "MPlayer",        NULL,   NULL,   1 << 7, True,   -1 }, /*                True }, \ */
  32.     { "stalonetray",    NULL,   NULL,   ~0,     False,  -1 },
  33.     { "Firefox",        NULL,   NULL,   1 << 2, False,  -1 },
  34.     { "Roxterm",        NULL,   NULL,   1 << 1, False,  -1 },
  35.     { "Thunderbird",    NULL,   NULL,   1 << 4, False,  -1 },
  36.     { "Pidgin",         NULL,   NULL,   1 << 3, False,  -1 },
  37.     { "Vacuum",         NULL,   NULL,   1 << 3, False,  -1 },
  38.     { "Skype",          NULL,   NULL,   1 << 5, False,  -1 },
  39.     { "mocp",           NULL,   NULL,   1 << 6, False,  -1 },
  40.     { "virtualbox",     NULL,   NULL,   1 << 8, False,  -1 },
  41. };
  42.  
  43. /* layout(s) */
  44. static const float mfact      = 0.55; /* factor of master area size [0.05..0.95] */
  45. static const int nmaster      = 1;    /* number of clients in master area */
  46. static const Bool resizehints = True; /* True means respect size hints in tiled resizals */
  47.  
  48. static const Layout layouts[] = {
  49.     /* symbol     arrange function */
  50.     { "[]=",      tile },    /* first entry is default */
  51.     { "[M]",      monocle },
  52.     { "><>",      NULL },    /* no layout function means floating behavior */
  53. };
  54.  
  55. /* key definitions */
  56. #define MODKEY Mod4Mask
  57. #define TAGKEYS(KEY,TAG) \
  58. { MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
  59. { MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
  60. { MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
  61. { MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
  62.  
  63. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  64. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  65.  
  66. /* commands */
  67. static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
  68. static const char *termcmd[]  = { "roxterm", NULL };
  69. static const char *apluscmd[] = { "amixer", "sset", "Front", "1+", NULL };
  70. static const char *aminuscmd[] = { "amixer", "sset", "Front", "1-", NULL };
  71. static const char *scrshoot_window[] = { "xfce4-screenshooter", "-x" , NULL };
  72. static const char *scrshoot_display[] = { "xfce4-screenshooter", NULL };
  73. static const char *scrshoot_region[] = { "xfce4-screenshooter", "-r", NULL };
  74.  
  75.  
  76. static Key keys[] = {
  77.     /* modifier                     key        function        argument */
  78.     { MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
  79.     { MODKEY|ControlMask,           XK_Return, spawn,          {.v = termcmd } },
  80.     { MODKEY,                       XK_Print,  spawn,          {.v = scrshoot_display } },
  81.     { ShiftMask,                    XK_Print,  spawn,          {.v = scrshoot_window } },
  82.     { ControlMask,                  XK_Print,  spawn,          {.v = scrshoot_region } },
  83.     { MODKEY,                       XK_b,      togglebar,      {0} },
  84.     { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
  85.     { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
  86.     { MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
  87.     { MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
  88.     { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
  89.     { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
  90.     { MODKEY,                       XK_Return, zoom,           {0} },
  91.     { MODKEY,                       XK_Tab,    view,           {0} },
  92.     { MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
  93.     { MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
  94.     { MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
  95.     { MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
  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|ControlMask,             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