Configuration file for DWM on MacBook Air
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

162 lines
9.3 KiB

3 years ago
3 years ago
3 years ago
3 years ago
9 years ago
2 years ago
2 years ago
9 years ago
2 years ago
9 years ago
16 years ago
3 years ago
16 years ago
16 years ago
16 years ago
3 years ago
3 years ago
3 years ago
16 years ago
  1. /* See LICENSE file for copyright and license details. */
  2. #include <X11/XF86keysym.h>
  3. /*volume*/
  4. static const char *upvol[] = { "/usr/bin/pactl", "set-sink-volume", "0", "+5%", NULL };
  5. static const char *downvol[] = { "/usr/bin/pactl", "set-sink-volume", "0", "-5%", NULL };
  6. static const char *mutevol[] = { "/usr/bin/pactl", "set-sink-mute", "0", "toggle", NULL };
  7. static const char *card0[] = { "/usr/bin/pactl", "set-default-sink", "1"};
  8. /*Keyboard backlight*/
  9. static const char *kbdbrightup[] = { "brightnessctl", "-d", "smc::kbd_backlight", "s", "+10%" };
  10. static const char *kbdbrightdown[] = { "brightnessctl", "-d", "smc::kbd_backlight", "s", "10%-" };
  11. /*Screen backlight*/
  12. static const char *brightup[] = { "brightnessctl", "-d", "intel_backlight", "s", "+5%" };
  13. static const char *brightdown[] = { "brightnessctl", "-d", "intel_backlight", "s", "5%-" };
  14. /* appearance */
  15. static const unsigned int borderpx = 5; /* border pixel of windows */
  16. static const unsigned int gappx = 5; /* gaps between windows */
  17. static const unsigned int snap = 32; /* snap pixel */
  18. static const int showbar = 1; /* 0 means no bar */
  19. static const int topbar = 1; /* 0 means bottom bar */
  20. //static const int extrabar = 1; /* 0 means no extra bar */
  21. //static const char statussep = ';'; /* separator between statuses */
  22. static const char *fonts[] = { "SourceCodePro:size=12" };
  23. static const char dmenufont[] = "SourceCodePro:size=15";
  24. static const char col_gray1[] = "#1D2330";
  25. static const char col_gray2[] = "#1D2330";//"#444444";
  26. static const char col_gray3[] = "#bbbbbb";//"#bbbbbb";
  27. static const char col_gray4[] = "#aaaaaa";//"#eeeeee";
  28. static const char col_purple[] = "#441188";//"#005577";
  29. static const char col_cyan[] = "#441188";//"#005577";
  30. static const char col_blue[] = "#005577";
  31. static const char col_green[] = "#248f11";
  32. static const unsigned int baralpha = 0xd0;
  33. static const unsigned int borderalpha = OPAQUE;
  34. static const char *colors[][3] = {
  35. /* fg bg border */
  36. [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
  37. //[SchemeSel] = { col_gray4, col_cyan, col_cyan },
  38. [SchemeSel] = { col_gray4, col_purple, col_green },
  39. };
  40. static const unsigned int alphas[][3] = {
  41. /* fg bg border */
  42. [SchemeNorm] = { OPAQUE, baralpha, borderalpha },
  43. [SchemeSel] = { OPAQUE, baralpha, borderalpha },
  44. };
  45. /* tagging */
  46. //static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
  47. static const char *tags[] = { "1", "2", "3","4", "5", "6", "7", "8", "9" };
  48. static const Rule rules[] = {
  49. /* xprop(1):
  50. * WM_CLASS(STRING) = instance, class
  51. * WM_NAME(STRING) = title
  52. */
  53. /* class instance title tags mask isfloating monitor */
  54. { "Gimp", NULL, NULL, 0, 1, -1 },
  55. { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
  56. { "imagej", NULL, NULL, 0, 1, -1 },
  57. { "processing-app-Base", NULL, NULL,1 << 5, 0, -1 },
  58. //{ "Alacritty", NULL, NULL, 1 << 2, 0, -1 },
  59. { "Brave-browser", NULL, NULL, 1 << 0, 0, -1 },
  60. };
  61. /* layout(s) */
  62. static const float mfact = 0.5; /* 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 = 1; /* 1 means respect size hints in tiled resizals */
  65. static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
  66. static const Layout layouts[] = {
  67. /* symbol arrange function */
  68. { "[]=", tile }, /* first entry is default */
  69. { "><>", NULL }, /* no layout function means floating behavior */
  70. { "[M]", monocle },
  71. };
  72. /* key definitions */
  73. #define MODKEY Mod4Mask
  74. #define TAGKEYS(KEY,TAG) \
  75. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  76. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  77. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  78. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  79. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  80. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  81. /* commands */
  82. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  83. static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
  84. static const char *termcmd[] = { "alacritty", NULL };
  85. static Key keys[] = {
  86. /* modifier key function argument */
  87. { MODKEY, XK_p, spawn, {.v = dmenucmd } },
  88. { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
  89. { MODKEY, XK_b, togglebar, {0} },
  90. // { MODKEY|ShiftMask, XK_b, toggleextrabar, {0} },
  91. { MODKEY, XK_j, focusstack, {.i = +1 } },
  92. { MODKEY, XK_k, focusstack, {.i = -1 } },
  93. { MODKEY, XK_i, incnmaster, {.i = +1 } },
  94. { MODKEY, XK_d, incnmaster, {.i = -1 } },
  95. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  96. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  97. { MODKEY, XK_Return, zoom, {0} },
  98. { MODKEY, XK_Tab, view, {0} },
  99. { MODKEY|ShiftMask, XK_c, killclient, {0} },
  100. { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
  101. { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
  102. { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
  103. { MODKEY, XK_space, setlayout, {0} },
  104. { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
  105. { MODKEY, XK_0, view, {.ui = ~0 } },
  106. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  107. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  108. { MODKEY, XK_period, focusmon, {.i = +1 } },
  109. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  110. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  111. { MODKEY, XK_minus, setgaps, {.i = -1 } },
  112. { MODKEY, XK_equal, setgaps, {.i = +1 } },
  113. { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
  114. TAGKEYS( XK_1, 0)
  115. TAGKEYS( XK_2, 1)
  116. TAGKEYS( XK_3, 2)
  117. TAGKEYS( XK_4, 3)
  118. TAGKEYS( XK_5, 4)
  119. TAGKEYS( XK_6, 5)
  120. TAGKEYS( XK_7, 6)
  121. TAGKEYS( XK_8, 7)
  122. TAGKEYS( XK_9, 8)
  123. { MODKEY|ShiftMask, XK_q, quit, {0} },
  124. { 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } },
  125. { 0, XF86XK_AudioMute, spawn, {.v = mutevol } },
  126. { 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } },
  127. { 0, XF86XK_KbdBrightnessUp, spawn, {.v = kbdbrightup } },
  128. { 0, XF86XK_KbdBrightnessDown,spawn, {.v = kbdbrightdown } },
  129. { 0, XF86XK_MonBrightnessUp, spawn, {.v = brightup } },
  130. { 0, XF86XK_MonBrightnessDown,spawn, {.v = brightdown } },
  131. };
  132. /* button definitions */
  133. /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  134. static Button buttons[] = {
  135. /* click event mask button function argument */
  136. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  137. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  138. { ClkWinTitle, 0, Button2, zoom, {0} },
  139. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  140. // { ClkExBarLeftStatus, 0, Button2, spawn, {.v = termcmd } },
  141. // { ClkExBarMiddle, 0, Button2, spawn, {.v = termcmd } },
  142. // { ClkExBarRightStatus, 0, Button2, spawn, {.v = termcmd } },
  143. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  144. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  145. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  146. { ClkTagBar, 0, Button1, view, {0} },
  147. { ClkTagBar, 0, Button3, toggleview, {0} },
  148. { ClkTagBar, MODKEY, Button1, tag, {0} },
  149. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  150. };