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.

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