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.

167 lines
9.7 KiB

2 years ago
2 years ago
2 years ago
2 years ago
8 years ago
2 years ago
2 years ago
8 years ago
2 years ago
1 year ago
1 year ago
8 years ago
16 years ago
2 years ago
16 years ago
16 years ago
16 years ago
2 years ago
2 years ago
2 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 << 3, 0, -1 },
  58. { "Rocket.Chat", NULL, NULL, 1 << 1, 0, -1 },
  59. //{ "Gnome-pomodoro", NULL, NULL, 1 << 8, 0, -1 },
  60. { "Thunar", NULL, NULL, 1 << 6, 0, -1 },
  61. { "Thunerbird", NULL, NULL, 1 << 7, 0, -1 },
  62. //{ "Alacritty", NULL, NULL, 1 << 2, 0, -1 },
  63. { "Brave-browser", NULL, NULL, 1 << 0, 0, -1 },
  64. { "Emacs", NULL, NULL, 1 << 4, 0, -1 },
  65. };
  66. /* layout(s) */
  67. static const float mfact = 0.5; /* factor of master area size [0.05..0.95] */
  68. static const int nmaster = 1; /* number of clients in master area */
  69. static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
  70. static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
  71. static const Layout layouts[] = {
  72. /* symbol arrange function */
  73. { "[]=", tile }, /* first entry is default */
  74. { "><>", NULL }, /* no layout function means floating behavior */
  75. { "[M]", monocle },
  76. };
  77. /* key definitions */
  78. #define MODKEY Mod4Mask
  79. #define TAGKEYS(KEY,TAG) \
  80. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  81. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  82. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  83. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  84. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  85. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  86. /* commands */
  87. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  88. static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
  89. static const char *termcmd[] = { "alacritty", NULL };
  90. static Key keys[] = {
  91. /* modifier key function argument */
  92. { MODKEY, XK_p, spawn, {.v = dmenucmd } },
  93. { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
  94. { MODKEY, XK_b, togglebar, {0} },
  95. // { MODKEY|ShiftMask, XK_b, toggleextrabar, {0} },
  96. { MODKEY, XK_j, focusstack, {.i = +1 } },
  97. { MODKEY, XK_k, focusstack, {.i = -1 } },
  98. { MODKEY, XK_i, incnmaster, {.i = +1 } },
  99. { MODKEY, XK_d, incnmaster, {.i = -1 } },
  100. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  101. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  102. { MODKEY, XK_Return, zoom, {0} },
  103. { MODKEY, XK_Tab, view, {0} },
  104. { MODKEY|ShiftMask, XK_c, killclient, {0} },
  105. { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
  106. { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
  107. { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
  108. { MODKEY, XK_space, setlayout, {0} },
  109. { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
  110. { MODKEY, XK_0, view, {.ui = ~0 } },
  111. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  112. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  113. { MODKEY, XK_period, focusmon, {.i = +1 } },
  114. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  115. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  116. { MODKEY, XK_minus, setgaps, {.i = -1 } },
  117. { MODKEY, XK_equal, setgaps, {.i = +1 } },
  118. { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
  119. TAGKEYS( XK_1, 0)
  120. TAGKEYS( XK_2, 1)
  121. TAGKEYS( XK_3, 2)
  122. TAGKEYS( XK_4, 3)
  123. TAGKEYS( XK_5, 4)
  124. TAGKEYS( XK_6, 5)
  125. TAGKEYS( XK_7, 6)
  126. TAGKEYS( XK_8, 7)
  127. TAGKEYS( XK_9, 8)
  128. { MODKEY|ShiftMask, XK_q, quit, {0} },
  129. { 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } },
  130. { 0, XF86XK_AudioMute, spawn, {.v = mutevol } },
  131. { 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } },
  132. { 0, XF86XK_KbdBrightnessUp, spawn, {.v = kbdbrightup } },
  133. { 0, XF86XK_KbdBrightnessDown,spawn, {.v = kbdbrightdown } },
  134. { 0, XF86XK_MonBrightnessUp, spawn, {.v = brightup } },
  135. { 0, XF86XK_MonBrightnessDown,spawn, {.v = brightdown } },
  136. };
  137. /* button definitions */
  138. /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  139. static Button buttons[] = {
  140. /* click event mask button function argument */
  141. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  142. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  143. { ClkWinTitle, 0, Button2, zoom, {0} },
  144. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  145. // { ClkExBarLeftStatus, 0, Button2, spawn, {.v = termcmd } },
  146. // { ClkExBarMiddle, 0, Button2, spawn, {.v = termcmd } },
  147. // { ClkExBarRightStatus, 0, Button2, spawn, {.v = termcmd } },
  148. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  149. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  150. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  151. { ClkTagBar, 0, Button1, view, {0} },
  152. { ClkTagBar, 0, Button3, toggleview, {0} },
  153. { ClkTagBar, MODKEY, Button1, tag, {0} },
  154. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  155. };