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.

151 lines
8.5 KiB

  1. /* See LICENSE file for copyright and license details. */
  2. #include <X11/XF86keysym.h>
  3. /*volume*/
  4. #define DISPLAY "alsa_output.usb-Apple_Inc._Display_Audio_0E020A16-00.analog-stereo"
  5. static const char *upvol[] = { "/usr/bin/pactl", "set-sink-volume", DISPLAY, "+5%", NULL };
  6. static const char *downvol[] = { "/usr/bin/pactl", "set-sink-volume", DISPLAY, "-5%", NULL };
  7. static const char *mutevol[] = { "/usr/bin/pactl", "set-sink-mute", DISPLAY, "toggle", NULL };
  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 char *fonts[] = { "SourceCodePro:size=14" };
  21. static const char dmenufont[] = "SourceCodePro:size=14";
  22. static const char col_gray1[] = "#1D2330";
  23. static const char col_gray2[] = "#1D2330";//"#444444";
  24. static const char col_gray3[] = "#bbbbbb";//"#bbbbbb";
  25. static const char col_gray4[] = "#aaaaaa";//"#eeeeee";
  26. static const char col_cyan[] = "#441188";//"#005577";
  27. static const unsigned int baralpha = 0xd0;
  28. static const unsigned int borderalpha = OPAQUE;
  29. static const char *colors[][3] = {
  30. /* fg bg border */
  31. [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
  32. [SchemeSel] = { col_gray4, col_cyan, col_cyan },
  33. };
  34. static const unsigned int alphas[][3] = {
  35. /* fg bg border */
  36. [SchemeNorm] = { OPAQUE, baralpha, borderalpha },
  37. [SchemeSel] = { OPAQUE, baralpha, borderalpha },
  38. };
  39. /* tagging */
  40. //static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
  41. static const char *tags[] = { "", "", "" ,"", "", "", "", "", "" };
  42. static const Rule rules[] = {
  43. /* xprop(1):
  44. * WM_CLASS(STRING) = instance, class
  45. * WM_NAME(STRING) = title
  46. */
  47. /* class instance title tags mask isfloating monitor */
  48. { "Gimp", NULL, NULL, 0, 1, -1 },
  49. //{ "Brave", NULL, NULL, 0<<1, 0, -1 },
  50. { "imagej", NULL, NULL, 0, 1, -1 },
  51. { "eclipse", NULL, NULL, 1<<4, 1, -1 },
  52. { "Arduino", NULL, NULL, 1<<4, 1, -1 },
  53. };
  54. /* layout(s) */
  55. static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
  56. static const int nmaster = 1; /* number of clients in master area */
  57. static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
  58. static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
  59. static const Layout layouts[] = {
  60. /* symbol arrange function */
  61. { "[]-", tile }, /* first entry is default */
  62. { "><>", NULL }, /* no layout function means floating behavior */
  63. { "[M]", monocle },
  64. };
  65. /* key definitions */
  66. #define MODKEY Mod4Mask
  67. #define TAGKEYS(KEY,TAG) \
  68. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  69. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  70. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  71. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  72. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  73. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  74. /* commands */
  75. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  76. static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
  77. static const char *termcmd[] = { "alacritty", NULL };
  78. static Key keys[] = {
  79. /* modifier key function argument */
  80. { MODKEY, XK_p, spawn, {.v = dmenucmd } },
  81. { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
  82. { MODKEY, XK_b, togglebar, {0} },
  83. { MODKEY, XK_j, focusstack, {.i = +1 } },
  84. { MODKEY, XK_k, focusstack, {.i = -1 } },
  85. { MODKEY, XK_i, incnmaster, {.i = +1 } },
  86. { MODKEY, XK_d, incnmaster, {.i = -1 } },
  87. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  88. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  89. { MODKEY, XK_Return, zoom, {0} },
  90. { MODKEY, XK_Tab, view, {0} },
  91. { MODKEY|ShiftMask, XK_c, killclient, {0} },
  92. { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
  93. { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
  94. { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
  95. { MODKEY, XK_space, setlayout, {0} },
  96. { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
  97. { MODKEY, XK_0, view, {.ui = ~0 } },
  98. { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
  99. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  100. { MODKEY, XK_period, focusmon, {.i = +1 } },
  101. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  102. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  103. { MODKEY, XK_minus, setgaps, {.i = -1 } },
  104. { MODKEY, XK_equal, setgaps, {.i = +1 } },
  105. { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
  106. TAGKEYS( XK_1, 0)
  107. TAGKEYS( XK_2, 1)
  108. TAGKEYS( XK_3, 2)
  109. TAGKEYS( XK_4, 3)
  110. TAGKEYS( XK_5, 4)
  111. TAGKEYS( XK_6, 5)
  112. TAGKEYS( XK_7, 6)
  113. TAGKEYS( XK_8, 7)
  114. TAGKEYS( XK_9, 8)
  115. { MODKEY|ShiftMask, XK_q, quit, {0} },
  116. { 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } },
  117. { 0, XF86XK_AudioMute, spawn, {.v = mutevol } },
  118. { 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } },
  119. { 0, XF86XK_KbdBrightnessUp, spawn, {.v = kbdbrightup } },
  120. { 0, XF86XK_KbdBrightnessDown,spawn, {.v = kbdbrightdown } },
  121. { 0, XF86XK_MonBrightnessUp, spawn, {.v = brightup } },
  122. { 0, XF86XK_MonBrightnessDown,spawn, {.v = brightdown } },
  123. };
  124. /* button definitions */
  125. /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  126. static Button buttons[] = {
  127. /* click event mask button function argument */
  128. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  129. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  130. { ClkWinTitle, 0, Button2, zoom, {0} },
  131. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  132. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  133. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  134. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  135. { ClkTagBar, 0, Button1, view, {0} },
  136. { ClkTagBar, 0, Button3, toggleview, {0} },
  137. { ClkTagBar, MODKEY, Button1, tag, {0} },
  138. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  139. };