Another copy of my dotfiles. Because I don't completely trust GitHub.
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.

245 lines
15 KiB

4 years ago
  1. /* See LICENSE file for copyright and license details. */
  2. #include <X11/XF86keysym.h>
  3. /* appearance */
  4. static const unsigned int borderpx = 3; /* border pixel of windows */
  5. static const unsigned int gappx = 6;
  6. static const unsigned int snap = 32; /* snap pixel */
  7. static const int rmaster = 0; /* 1 = master at right*/
  8. static const int showbar = 1; /* 0 means no bar */
  9. static const int topbar = 1; /* 0 means bottom bar */
  10. static const int user_bh = 27; /* 0 means that dwm will calculate bar height, >= 1 means dwm will user_bh as bar height */
  11. static const int tag_padding = 0;
  12. static const int vertpad = 0; /* vertical padding of bar */
  13. static const int sidepad = 0; /* horizontal padding of bar */
  14. static const char *fonts[] = {"Hack Nerd Font:Regular:size=10", "Material Design Icons:Regular:pixelsize=16:antialias=true"};
  15. static const char dmenufont[] = "Hack Nerd Font:size=10";
  16. static const char fore[] = "#f8f8f2";
  17. static const char back[] = "#282a36";
  18. static const char border[] = "#f8f8f2";
  19. static const char col0[] = "#000000";
  20. static const char col1[] = "#FF5555";
  21. static const char col2[] = "#50FA7B";
  22. static const char col3[] = "#F1FA8C";
  23. static const char col4[] = "#BD93F9";
  24. static const char col5[] = "#FF79C6";
  25. static const char col6[] = "#8BE9FD";
  26. static const char col7[] = "#BFBFBF";
  27. static const char col8[] = "#4D4D4D";
  28. static const char col9[] = "#FF6E67";
  29. static const char col10[] = "#5AF78E";
  30. static const char col11[] = "#F4F99D";
  31. static const char col12[] = "#CAA9FA";
  32. static const char col13[] = "#FF92D0";
  33. static const char col14[] = "#9AEDFE";
  34. static const char col15[] = "#E6E6E6";
  35. static const char spotify[]= "#1FC167";
  36. static const char *colors[][3] = {
  37. /* fg bg border */
  38. [SchemeNorm] = { fore, back, back }, // \x0b
  39. [SchemeSel] = { fore, back, border }, // \x0c
  40. [SchemeStatus] = { fore, back, border }, // \x0d Statusbar right
  41. [SchemeTagsSel] = { col4, back, border }, // \x0e Tagbar left selected
  42. [SchemeTagsNorm] = { fore, back, border }, // \x0f Tagbar left unselected
  43. [SchemeInfoSel] = { fore, back, border }, // \x10 infobar middle selected
  44. [SchemeInfoNorm] = { fore, back, border }, // \x11 infobar middle unselected
  45. [SchemeCol1] = { col1, back, col0 }, // \x12
  46. [SchemeCol2] = { col2, back, col0 }, // \x13
  47. [SchemeCol3] = { col3, back, col0 }, // \x14
  48. [SchemeCol4] = { col4, back, col0 }, // \x15
  49. [SchemeCol5] = { col5, back, col0 }, // \x16
  50. [SchemeCol6] = { col6, back, col0 }, // \x17
  51. [SchemeCol7] = { col7, back, col0 }, // \x18
  52. [SchemeCol8] = { col8, back, col0 }, // \x19
  53. [SchemeCol9] = { col9, back, col0 }, // \x1a
  54. [SchemeCol10] = { col10, back, col0 }, // \x1b
  55. [SchemeCol11] = { col11, back, col0 }, // \x1c
  56. [SchemeCol12] = { spotify, back, col0 }, // \x1d Spotify
  57. };
  58. /* tagging */
  59. static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"};
  60. //static const char *alttags[] = { "󰄯", "󰄯", "󰄯", "󰄯"};
  61. static const Rule rules[] = {
  62. /* xprop(1):
  63. * WM_CLASS(STRING) = instance, class
  64. * WM_NAME(STRING) = title
  65. */
  66. /* class instance title tags mask isfloating monitor */
  67. { "discord", NULL, NULL, 1 << 8, 0, -1 },
  68. { "Termite", NULL, NULL, 1 << 0, 0, -1 },
  69. { "firefoxdeveloperedition", NULL, NULL, 1 << 1, 0, -1 },
  70. { "Tor Browser", NULL, NULL, 1 << 1, 0, -1 },
  71. { "Chromium", NULL, NULL, 1 << 1, 0, -1 },
  72. { "zoom", NULL, NULL, 1 << 4, 0, -1 },
  73. { "TelegramDesktop", NULL, NULL, 1 << 8, 0, -1 },
  74. { "whatsapp-nativefier-d52542", NULL, NULL, 1 << 8, 0, -1 },
  75. { "neomutt", NULL, NULL, 1 << 7, 0, -1 },
  76. { "Sublime_Text", NULL, NULL, 1 << 2, 0, -1 },
  77. { "code-oss", NULL, NULL, 1 << 2, 0, -1 },
  78. { "jetbrains-idea", NULL, NULL, 1 << 2, 0, -1 },
  79. { "Nemo", NULL, NULL, 1 << 3, 1, -1 },
  80. { "Spotify", NULL, NULL, 1 << 9, 0, -1 },
  81. };
  82. /* layout(s) */
  83. static const float mfact = 0.5; /* factor of master area size [0.05..0.95] */
  84. static const int nmaster = 1; /* number of clients in master area */
  85. static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
  86. #include "fibonacci.c"
  87. #include "layouts.c"
  88. static const Layout layouts[] = {
  89. /* symbol arrange function */
  90. { "鉶", tile }, /* first entry is default */
  91. { "", dwindle },
  92. { "ﱖ", grid },
  93. { "", centeredmaster },
  94. { "", centeredfloatingmaster },
  95. { "[M]", monocle },
  96. { "[D]", deck },
  97. { NULL, NULL },
  98. };
  99. /* key definitions */
  100. #define MODKEY Mod4Mask
  101. #define TAGKEYS(KEY,TAG) \
  102. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  103. { MODKEY|Mod1Mask, KEY, toggleview, {.ui = 1 << TAG} }, \
  104. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  105. { MODKEY|ControlMask, KEY, toggletag, {.ui = 1 << TAG} },
  106. /* COSAS QUE TENGO QUE AVERIGUAR COMO QUITAR */
  107. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  108. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  109. static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
  110. static const char *dmenucmd[] = { "/usr/bin/rofi","-show","drun", NULL };
  111. static const char *termcmd[] = { "/usr/bin/termite", "--title", "Terminal", NULL };
  112. static const char *upvol[] = { "/usr/bin/pactl", "set-sink-volume", "0", "+5%", NULL };
  113. static const char *downvol[] = { "/usr/bin/pactl", "set-sink-volume", "0", "-5%", NULL };
  114. static const char *mutevol[] = { "/usr/bin/pactl", "set-sink-mute", "0", "toggle", NULL };
  115. static const char *upbright[] = {"/usr/bin/xbacklight","-inc","10",NULL};
  116. static const char *downbright[] = {"/usr/bin/xbacklight","-dec","10",NULL};
  117. static const char *lock[] = {"/usr/bin/betterlockscreen","-l","-t","Stay the fuck out!",NULL};
  118. static const char *clipmenu[] = {"/usr/bin/clipmenu","-i",NULL};
  119. static const char *play[] = {"/usr/bin/playerctl","play-pause",NULL};
  120. static const char *prev[] = {"/usr/bin/playerctl","previous",NULL};
  121. static const char *next[] = {"/usr/bin/playerctl","next",NULL};
  122. static const char *outmenu[] = {"/home/yigit/.scripts/dmenu-logout"};
  123. static const char *bwmenu[] = {"/usr/bin/bwmenu", "--auto-lock", "-1"};
  124. static const char *trackpad[] = {"/home/yigit/.scripts/toggle_touchpad.sh"};
  125. static const char *screenshot[] = { "scrot","-d","3", "%Y-%m-%d-%s_$wx$h.jpg", "-e","xclip -selection clipboard -t image/jpg < $f; mv $f ~/Pictures/Screenshots/;dunstify -a 'SNAP' 'Email taken'", NULL };
  126. static const char *windowshot[] = { "scrot", "-u", "-d","3", "%Y-%m-%d-%s_$wx$h.jpg", "-e","xclip -selection clipboard -t image/jpg < $f; mv $f ~/Pictures/Screenshots/;dunstify -a 'SNAP' 'Email taken'", NULL };
  127. /* commands */
  128. #include "movestack.c"
  129. #include "shiftview.c"
  130. static Key keys[] = {
  131. /* modifier key function argument */
  132. { MODKEY, XK_d, spawn, {.v = dmenucmd } },
  133. { MODKEY, XK_p, spawn, {.v = bwmenu } },
  134. { MODKEY, XK_Return, spawn, {.v = termcmd } },
  135. { MODKEY, XK_b, togglebar, {0} },
  136. { MODKEY, XK_j, focusstack, {.i = +1 } },
  137. { MODKEY, XK_k, focusstack, {.i = -1 } },
  138. { MODKEY, XK_i, incnmaster, {.i = +1 } },
  139. { MODKEY, XK_s, incnmaster, {.i = -1 } },
  140. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  141. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  142. { MODKEY|ShiftMask, XK_Return, zoom, {0} },
  143. { MODKEY, XK_Tab, view, {0} },
  144. { MODKEY, XK_q, killclient, {0} },
  145. { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } }, /*Mover ventana hacia abajo*/
  146. { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } }, /*Mover ventana hacia arriba*/
  147. { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, /*tiled*/
  148. { MODKEY|Mod1Mask, XK_f, setlayout, {.v = &layouts[1]} }, /*Spiral*/
  149. { MODKEY|Mod1Mask, XK_g, setlayout, {.v = &layouts[2]} }, /*Grid*/
  150. { MODKEY|Mod1Mask, XK_c, setlayout, {.v = &layouts[3]} }, /*center*/
  151. { MODKEY, XK_m, setlayout, {.v = &layouts[5]} }, /*monocle*/
  152. { MODKEY|ShiftMask, XK_m, setlayout, {.v = &layouts[6]} }, /*Deck*/
  153. { MODKEY, XK_s, togglefloating, {0} }, /*float*/
  154. { MODKEY, XK_f, togglefullscr, {0} }, /*Fullscreen*/
  155. { MODKEY|Mod1Mask, XK_comma, cyclelayout, {.i = -1 } }, /*Ciclar layouts*/
  156. { MODKEY|Mod1Mask, XK_period, cyclelayout, {.i = +1 } }, /*Ciclar layouts*/
  157. { MODKEY, XK_a, view, {.ui = ~0 } },
  158. { MODKEY|ShiftMask, XK_a, tag, {.ui = ~0 } },
  159. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  160. { MODKEY, XK_period, focusmon, {.i = +1 } },
  161. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  162. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  163. /*Monitores*/
  164. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, /*Mandar ventana a monitor anterior*/
  165. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, /*Mandar ventana a monitor siguiente*/
  166. TAGKEYS( XK_1, 0)
  167. TAGKEYS( XK_2, 1)
  168. TAGKEYS( XK_3, 2)
  169. TAGKEYS( XK_4, 3)
  170. TAGKEYS( XK_5, 4)
  171. TAGKEYS( XK_6, 5)
  172. TAGKEYS( XK_7, 6)
  173. TAGKEYS( XK_8, 7)
  174. TAGKEYS( XK_9, 8)
  175. TAGKEYS( XK_0, 9)
  176. { MODKEY|ShiftMask, XK_q, spawn, {.v = outmenu} },
  177. { MODKEY|ShiftMask, XK_t, spawn, {.v = trackpad} },
  178. { MODKEY, XK_x, spawn, {.v = lock } },
  179. { MODKEY, XK_c, spawn, {.v = clipmenu } },
  180. { 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } },
  181. { 0, XF86XK_MonBrightnessUp, spawn, {.v = upbright } },
  182. { 0, XF86XK_MonBrightnessDown, spawn, {.v = downbright } },
  183. { 0, XF86XK_AudioMute, spawn, {.v = mutevol } },
  184. { 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } },
  185. { 0, XF86XK_AudioPrev, spawn, {.v = prev } },
  186. { 0, XF86XK_AudioPlay, spawn, {.v = play } },
  187. { 0, XF86XK_AudioNext, spawn, {.v = next } },
  188. { 0, XK_Print, spawn, {.v = screenshot } },
  189. { MODKEY, XK_Print, spawn, {.v = windowshot } },
  190. };
  191. /* button definitions */
  192. /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  193. static Button buttons[] = {
  194. /* click event mask button function argument */
  195. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  196. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  197. { ClkWinTitle, 0, Button2, zoom, {0} },
  198. { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
  199. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  200. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  201. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  202. { ClkTagBar, 0, Button1, view, {0} },
  203. { ClkTagBar, 0, Button3, toggleview, {0} },
  204. { ClkTagBar, MODKEY, Button1, tag, {0} },
  205. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  206. };
  207. /*
  208. static Button buttons[] = {
  209. // click event mask button function argument
  210. { ClkLtSymbol, 0, Button1, cyclelayout, {.i = +1 } },
  211. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[5]} },
  212. { ClkWinTitle, 0, Button2, zoom, {0} },
  213. { ClkStatusText, 0, Button1, sigdwmblocks, {.i = 1} },
  214. { ClkStatusText, 0, Button2, sigdwmblocks, {.i = 2} },
  215. { ClkStatusText, 0, Button3, sigdwmblocks, {.i = 3} },
  216. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  217. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  218. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  219. { ClkTagBar, 0, Button1, view, {0} },
  220. { ClkTagBar, 0, Button3, toggleview, {0} },
  221. { ClkTagBar, MODKEY, Button1, tag, {0} },
  222. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  223. { ClkClientWin, 0, Button1, winview, {0} },
  224. };
  225. */