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.

185 lines
13 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #include <X11/XF86keysym.h>
  2. /* key definitions */
  3. #define MODKEY Mod4Mask
  4. #define TAGKEYS(KEY,TAG) \
  5. { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
  6. { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
  7. { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
  8. { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
  9. /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  10. #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  11. static char dmenumon[2] = "0";
  12. static const char *dmenucmd[] = { "/home/yigit/.local/bin/dmenu_run_history", "-m", dmenumon, "-z", "1900", "-x", "10", "-y", "10"};
  13. static const char *termcmd[] = { "/usr/local/bin/st", NULL };
  14. static const char *tmuxcmd[] = { "/usr/local/bin/st","-e", "/home/yigit/.local/bin/st_tmux", NULL };
  15. static const char *rangercmd[] = { "/usr/local/bin/st","-c","ranger","-n","ranger","-e", "ranger", NULL };
  16. static const char *upvol[] = { "/home/yigit/.local/bin/pacontrol.sh", "up", NULL };
  17. static const char *downvol[] = { "/home/yigit/.local/bin/pacontrol.sh", "down", NULL };
  18. static const char *mutevol[] = { "/home/yigit/.local/bin/pacontrol.sh", "toggle-mute", NULL };
  19. static const char *upbright[] = {"/usr/bin/xbacklight","-inc","10",NULL};
  20. static const char *downbright[] = {"/usr/bin/xbacklight","-dec","10",NULL};
  21. static const char *lock[] = {"/home/yigit/.local/bin/lock",NULL};
  22. static const char *clipmenu[] = {"/usr/bin/clipmenu","-i",NULL};
  23. static const char *play[] = {"/usr/bin/playerctl","play-pause",NULL};
  24. static const char *prev[] = {"/usr/bin/playerctl","previous",NULL};
  25. static const char *next[] = {"/usr/bin/playerctl","next",NULL};
  26. static const char *outmenu[] = {"/home/yigit/.local/bin/dmenu-logout", NULL};
  27. static const char *refresh[] = {"/home/yigit/.local/bin/dmenu-refresh", NULL};
  28. static const char *keyboard[] = {"/home/yigit/.local/bin/kbmap_toggle", NULL};
  29. static const char *screenshot[] = { "scrot", "/tmp/%Y-%m-%d-%s_$wx$h.png", "-e","xclip -selection clipboard -target image/png -i $f; cp $f ~/Pictures/Screenshots;notify-send \"SNAP\" \"$f\"", NULL };
  30. static const char *windowshot[] = { "scrot", "-u", "/tmp/%Y-%m-%d-%s_$wx$h.png", "-e","xclip -selection clipboard -target image/png -i $f; cp $f ~/Pictures/Screenshots;notify-send \"SNAP\" \"$f\"", NULL };
  31. static const char *simcrop[] = {"simcrop","-fc","-sc", "-g", "900x500",NULL};
  32. static const char *notification[] = {"/home/yigit/.local/bin/dunst_toggle.sh", "-t",NULL};
  33. static const char *screensaver[] = {"/home/yigit/.local/bin/screensaver_toggle", "-t",NULL};
  34. static const char *online_class[] = {"/home/yigit/.local/bin/tedportal",NULL};
  35. static const char *bwmenu[] = {"/home/yigit/.local/bin/password_manager", NULL};
  36. static const char *wallabag_read[] = {"/home/yigit/.local/bin/dmenu-wallabag", "-l",NULL};
  37. static const char *wallabag_add[] = {"/home/yigit/.local/bin/dmenu-wallabag", "-a", NULL};
  38. static const char *network_manager[] = {"/home/yigit/.local/bin/networkmanager_dmenu", NULL};
  39. static const char *killall[] = {"/home/yigit/.local/bin/dmenu-killall", NULL};
  40. static const char *mconnect[] = {"/home/yigit/.local/bin/dmenu-mconnect"};
  41. static const char *udevil[] = {"/home/yigit/.local/bin/dmenu-udevil"};
  42. static const char *udevil_umount[] = {"/home/yigit/.local/bin/dmenu-udevil", "-u"};
  43. static const char *genpwd[] = {"sh", "-c","/sbin/bw generate | xclip" };
  44. static const char *trackpad[] = {"/home/yigit/.local/bin/toggle_touchpad.sh"};
  45. static const char *bluetooth[] = {"/home/yigit/.local/bin/dmenu-bluetooth", NULL};
  46. static const char *url[] = {"/home/yigit/.local/bin/dmenu_surf", NULL};
  47. static const char *surf[] = {"/home/yigit/.local/bin/tabbed_surf", NULL};
  48. static const char *google[] = {"/home/yigit/.local/bin/menu-surfraw", "google", NULL};
  49. static const char *youtube[] = {"/home/yigit/.local/bin/ytfzf_dmenu", NULL};
  50. /* commands */
  51. static Key keys[] = {
  52. /* modifier key function argument */
  53. { MODKEY, XK_d, spawn, {.v = dmenucmd } },
  54. { MODKEY, XK_p, spawn, {.v = bwmenu } },
  55. { MODKEY, XK_Return, spawn, {.v = termcmd } },
  56. { MODKEY|ShiftMask, XK_Return, spawn, {.v = tmuxcmd } },
  57. { MODKEY|ShiftMask, XK_f, spawn, {.v = rangercmd} },
  58. { MODKEY, XK_b, togglebar, {0} },
  59. { MODKEY, XK_j, focusstack, {.i = +1 } },
  60. { MODKEY|ShiftMask, XK_i, spawn, {.v = screensaver} },
  61. { MODKEY|ShiftMask, XK_n, spawn, {.v = notification } },
  62. { MODKEY, XK_k, focusstack, {.i = -1 } },
  63. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  64. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  65. { MODKEY|ShiftMask, XK_Return, zoom, {0} },
  66. { MODKEY, XK_Tab, view, {0} },
  67. { MODKEY, XK_q, killclient, {0} },
  68. { MODKEY|Mod1Mask, XK_i, incnmaster, {.i = +1 } },
  69. { MODKEY|Mod1Mask, XK_s, incnmaster, {.i = -1 } },
  70. { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } },
  71. { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } },
  72. { MODKEY|Mod1Mask, XK_t, setlayout, {.v = &layouts[0]} }, /*tiled*/
  73. { MODKEY|Mod1Mask, XK_f, setlayout, {.v = &layouts[1]} }, /*Spiral*/
  74. { MODKEY|Mod1Mask, XK_g, setlayout, {.v = &layouts[2]} }, /*Grid*/
  75. { MODKEY|Mod1Mask, XK_c, setlayout, {.v = &layouts[3]} }, /*center*/
  76. { MODKEY|Mod1Mask, XK_space, setlayout, {.v = &layouts[4]} }, /*Center floating*/
  77. { MODKEY|Mod1Mask, XK_m, setlayout, {.v = &layouts[5]} }, /*monocle*/
  78. { MODKEY|Mod1Mask, XK_d, setlayout, {.v = &layouts[6]} }, /*Deck*/
  79. { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, /* [>float<] */
  80. { MODKEY, XK_f, togglefullscreen, {0} }, /*[>Fullscreen<] */
  81. { MODKEY|Mod1Mask, XK_comma, cyclelayout, {.i = -1 } }, /*Ciclar layouts*/
  82. { MODKEY|Mod1Mask, XK_period, cyclelayout, {.i = +1 } }, /*Ciclar layouts*/
  83. { MODKEY, XK_a, view, {.ui = ~0 } },
  84. { MODKEY|ShiftMask, XK_a, tag, {.ui = ~0 } },
  85. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  86. { MODKEY, XK_period, focusmon, {.i = +1 } },
  87. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  88. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  89. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  90. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  91. TAGKEYS( XK_1, 0)
  92. TAGKEYS( XK_2, 1)
  93. TAGKEYS( XK_3, 2)
  94. TAGKEYS( XK_4, 3)
  95. TAGKEYS( XK_5, 4)
  96. TAGKEYS( XK_6, 5)
  97. TAGKEYS( XK_7, 6)
  98. TAGKEYS( XK_8, 7)
  99. TAGKEYS( XK_9, 8)
  100. { MODKEY|ShiftMask, XK_q, spawn, {.v = outmenu} },
  101. { MODKEY|ShiftMask, XK_t, spawn, {.v = trackpad} },
  102. { MODKEY, XK_x, spawn, {.v = lock } },
  103. { MODKEY|ShiftMask, XK_x, spawn, {.v = killall } },
  104. { MODKEY, XK_c, spawn, {.v = clipmenu } },
  105. { MODKEY|ShiftMask, XK_p, spawn, {.v = genpwd} },
  106. { MODKEY|ShiftMask, XK_b, spawn, {.v = bluetooth } },
  107. { MODKEY|Mod1Mask, XK_n, spawn, {.v = network_manager} }, /*Spiral*/
  108. { MODKEY|Mod1Mask, XK_k, spawn, {.v = keyboard} }, /*tiled*/
  109. { MODKEY|ShiftMask, XK_r, spawn, {.v = refresh} }, /*tiled*/
  110. { 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } },
  111. { 0, XF86XK_MonBrightnessUp, spawn, {.v = upbright } },
  112. { 0, XF86XK_MonBrightnessDown, spawn, {.v = downbright } },
  113. { 0, XF86XK_AudioMute, spawn, {.v = mutevol } },
  114. { 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } },
  115. { 0, XF86XK_AudioPrev, spawn, {.v = prev } },
  116. { 0, XF86XK_AudioPlay, spawn, {.v = play } },
  117. { 0, XF86XK_AudioNext, spawn, {.v = next } },
  118. { 0, XK_Print, spawn, {.v = screenshot } },
  119. { MODKEY, XK_Print, spawn, {.v = windowshot } },
  120. { MODKEY|ShiftMask, XK_e, spawn, {.v = simcrop } },
  121. { MODKEY, XK_u, spawn, {.v = url} },
  122. { MODKEY, XK_w, spawn, {.v = wallabag_read} },
  123. { MODKEY|ShiftMask, XK_w, spawn, {.v = wallabag_add} },
  124. { MODKEY, XK_g, spawn, {.v = google} },
  125. { MODKEY|ShiftMask, XK_c, spawn, {.v = online_class} },
  126. { MODKEY|ShiftMask, XK_m, spawn, {.v = mconnect} },
  127. { MODKEY|ShiftMask, XK_d, spawn, {.v = udevil} },
  128. { MODKEY|ShiftMask, XK_u, spawn, {.v = udevil_umount} },
  129. { MODKEY, XK_y, spawn, {.v = youtube} },
  130. { MODKEY, XK_s, togglescratch, {.ui = 0 } },
  131. { MODKEY|ShiftMask, XK_s, togglescratch, {.ui = 1 } },
  132. { MODKEY, XK_m, togglescratch, {.ui = 2 } },
  133. /* FloatPos Patch Keybinds */
  134. { Mod3Mask, XK_u, floatpos, {.v = "-26x -26y" } }, // ↖
  135. { Mod3Mask, XK_i, floatpos, {.v = " 0x -26y" } }, // ↑
  136. { Mod3Mask, XK_o, floatpos, {.v = " 26x -26y" } }, // ↗
  137. { Mod3Mask, XK_j, floatpos, {.v = "-26x 0y" } }, // ←
  138. { Mod3Mask, XK_l, floatpos, {.v = " 26x 0y" } }, // →
  139. { Mod3Mask, XK_m, floatpos, {.v = "-26x 26y" } }, // ↙
  140. { Mod3Mask, XK_comma, floatpos, {.v = " 0x 26y" } }, // ↓
  141. { Mod3Mask, XK_period, floatpos, {.v = " 26x 26y" } }, // ↘
  142. /* Resize client, client center position is fixed which means that client expands in all directions */
  143. { Mod3Mask|ShiftMask, XK_u, floatpos, {.v = "-26w -26h" } }, // ↖
  144. { Mod3Mask|ShiftMask, XK_i, floatpos, {.v = " 0w -26h" } }, // ↑
  145. { Mod3Mask|ShiftMask, XK_o, floatpos, {.v = " 26w -26h" } }, // ↗
  146. { Mod3Mask|ShiftMask, XK_j, floatpos, {.v = "-26w 0h" } }, // ←
  147. { Mod3Mask|ShiftMask, XK_k, floatpos, {.v = "800W 800H" } }, // ·
  148. { Mod3Mask|ShiftMask, XK_l, floatpos, {.v = " 26w 0h" } }, // →
  149. { Mod3Mask|ShiftMask, XK_m, floatpos, {.v = "-26w 26h" } }, // ↙
  150. { Mod3Mask|ShiftMask, XK_comma, floatpos, {.v = " 0w 26h" } }, // ↓
  151. { Mod3Mask|ShiftMask, XK_period, floatpos, {.v = " 26w 26h" } }, // ↘
  152. };
  153. /* button definitions */
  154. /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  155. static Button buttons[] = {
  156. /* click event mask button function argument */
  157. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  158. { ClkLtSymbol, 0, Button3, layoutmenu, {0} },
  159. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  160. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  161. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  162. { ClkTagBar, 0, Button1, view, {0} },
  163. { ClkTagBar, 0, Button3, toggleview, {0} },
  164. { ClkTagBar, MODKEY, Button1, tag, {0} },
  165. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  166. { ClkStatusText, 0, Button1, sigdwmblocks, {.i = 1 } },
  167. { ClkStatusText, 0, Button2, sigdwmblocks, {.i = 2 } },
  168. };