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.

144 lines
9.4 KiB

  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[] = { "dmenu_run", "-m", dmenumon, "-z", "1900", "-x", "10", "-y", "10"};
  13. static const char *termcmd[] = { "/usr/local/bin/st", NULL };
  14. static const char *upvol[] = { "/home/yigit/.scripts/pacontrol.sh", "up", NULL };
  15. static const char *downvol[] = { "/home/yigit/.scripts/pacontrol.sh", "down", NULL };
  16. static const char *mutevol[] = { "/home/yigit/.scripts/pacontrol.sh", "togglemute", NULL };
  17. static const char *upbright[] = {"/usr/bin/xbacklight","-inc","10",NULL};
  18. static const char *downbright[] = {"/usr/bin/xbacklight","-dec","10",NULL};
  19. static const char *lock[] = {"/usr/bin/betterlockscreen","-l","-t","Stay the fuck out!",NULL};
  20. static const char *clipmenu[] = {"/usr/bin/clipmenu","-i",NULL};
  21. static const char *play[] = {"/usr/bin/playerctl","play-pause",NULL};
  22. static const char *prev[] = {"/usr/bin/playerctl","previous",NULL};
  23. static const char *next[] = {"/usr/bin/playerctl","next",NULL};
  24. static const char *outmenu[] = {"/home/yigit/.scripts/dmenu-logout"};
  25. static const char *notification_off[] = {"/home/yigit/.scripts/dunst_toggle.sh","-s",NULL};
  26. static const char *notification_on[] = {"/home/yigit/.scripts/dunst_toggle.sh", "-e",NULL};
  27. static const char *bwmenu[] = {"/home/yigit/.scripts/password_manager", NULL};
  28. static const char *network_manager[] = {"/home/yigit/.scripts/networkmanager_dmenu"};
  29. static const char *trackpad[] = {"/home/yigit/.scripts/toggle_touchpad.sh"};
  30. static const char *kdeconnect[] = {"/home/yigit/.local/bin/dmenu_kdeconnect.sh", NULL};
  31. static const char *bluetooth[] = {"/home/yigit/.scripts/dmenu-bluetooth", NULL};
  32. 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 --icon='/home/yigit/.icons/Numix-Circle/48/apps/camera.svg' -a 'SNAP' 'Screenshot taken'", NULL };
  33. 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 --icon='/home/yigit/.icons/Numix-Circle/48/apps/camera.svg' -a 'SNAP' 'Screenshot taken'", NULL };
  34. static const char *url[] = {"/home/yigit/.scripts/dmenu_surf", NULL};
  35. static const char *surf[] = {"/home/yigit/.scripts/tabbed_surf", NULL};
  36. static const char *google[] = {"/home/yigit/.scripts/menu-surfraw", "google", NULL};
  37. static const char *youtube[] = {"/home/yigit/.scripts/menu-surfraw", "youtube", NULL};
  38. /* commands */
  39. static Key keys[] = {
  40. /* modifier key function argument */
  41. { MODKEY, XK_d, spawn, {.v = dmenucmd } },
  42. { MODKEY, XK_p, spawn, {.v = bwmenu } },
  43. { MODKEY, XK_Return, spawn, {.v = termcmd } },
  44. { MODKEY, XK_b, togglebar, {0} },
  45. { MODKEY, XK_j, focusstack, {.i = +1 } },
  46. { MODKEY, XK_n, spawn, {.v = notification_off} },
  47. { MODKEY|ShiftMask, XK_n, spawn, {.v = notification_on } },
  48. { MODKEY, XK_k, focusstack, {.i = -1 } },
  49. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  50. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  51. { MODKEY|ShiftMask, XK_Return, zoom, {0} },
  52. { MODKEY, XK_Tab, view, {0} },
  53. { MODKEY, XK_q, killclient, {0} },
  54. { MODKEY|Mod1Mask, XK_i, incnmaster, {.i = +1 } },
  55. { MODKEY|Mod1Mask, XK_s, incnmaster, {.i = -1 } },
  56. { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } },
  57. { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } },
  58. { MODKEY|Mod1Mask, XK_t, setlayout, {.v = &layouts[0]} }, /*tiled*/
  59. { MODKEY|Mod1Mask, XK_f, setlayout, {.v = &layouts[1]} }, /*Spiral*/
  60. { MODKEY|Mod1Mask, XK_g, setlayout, {.v = &layouts[2]} }, /*Grid*/
  61. { MODKEY|Mod1Mask, XK_c, setlayout, {.v = &layouts[3]} }, /*center*/
  62. { MODKEY|Mod1Mask, XK_d, setlayout, {.v = &layouts[4]} }, /*monocle*/
  63. { MODKEY|Mod1Mask, XK_m, setlayout, {.v = &layouts[5]} }, /*monocle*/
  64. { MODKEY|Mod1Mask, XK_m, setlayout, {.v = &layouts[6]} }, /*Deck*/
  65. { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, /* [>float<] */
  66. { MODKEY, XK_f, togglefullscreen, {0} }, /*[>Fullscreen<] */
  67. { MODKEY|Mod1Mask, XK_comma, cyclelayout, {.i = -1 } }, /*Ciclar layouts*/
  68. { MODKEY|Mod1Mask, XK_period, cyclelayout, {.i = +1 } }, /*Ciclar layouts*/
  69. { MODKEY, XK_a, view, {.ui = ~0 } },
  70. { MODKEY|ShiftMask, XK_a, tag, {.ui = ~0 } },
  71. { MODKEY, XK_comma, focusmon, {.i = -1 } },
  72. { MODKEY, XK_period, focusmon, {.i = +1 } },
  73. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  74. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  75. { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
  76. { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
  77. TAGKEYS( XK_1, 0)
  78. TAGKEYS( XK_2, 1)
  79. TAGKEYS( XK_3, 2)
  80. TAGKEYS( XK_4, 3)
  81. TAGKEYS( XK_5, 4)
  82. TAGKEYS( XK_6, 5)
  83. TAGKEYS( XK_7, 6)
  84. TAGKEYS( XK_8, 7)
  85. TAGKEYS( XK_9, 8)
  86. TAGKEYS( XK_0, 9)
  87. { MODKEY|ShiftMask, XK_q, spawn, {.v = outmenu} },
  88. { MODKEY|ShiftMask, XK_t, spawn, {.v = trackpad} },
  89. { MODKEY, XK_x, spawn, {.v = lock } },
  90. { MODKEY, XK_c, spawn, {.v = clipmenu } },
  91. { MODKEY|ShiftMask, XK_p, spawn, {.v = kdeconnect } },
  92. { MODKEY|ShiftMask, XK_b, spawn, {.v = bluetooth } },
  93. { MODKEY|Mod1Mask, XK_n, spawn, {.v = network_manager} }, /*Spiral*/
  94. { 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } },
  95. { 0, XF86XK_MonBrightnessUp, spawn, {.v = upbright } },
  96. { 0, XF86XK_MonBrightnessDown, spawn, {.v = downbright } },
  97. { 0, XF86XK_AudioMute, spawn, {.v = mutevol } },
  98. { 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } },
  99. { 0, XF86XK_AudioPrev, spawn, {.v = prev } },
  100. { 0, XF86XK_AudioPlay, spawn, {.v = play } },
  101. { 0, XF86XK_AudioNext, spawn, {.v = next } },
  102. { 0, XK_Print, spawn, {.v = screenshot } },
  103. { MODKEY, XK_Print, spawn, {.v = windowshot } },
  104. { MODKEY, XK_u, spawn, {.v = url} },
  105. { MODKEY, XK_s, spawn, {.v = surf} },
  106. { MODKEY, XK_g, spawn, {.v = google} },
  107. { MODKEY, XK_y, spawn, {.v = youtube} },
  108. };
  109. /* button definitions */
  110. /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
  111. static Button buttons[] = {
  112. /* click event mask button function argument */
  113. { ClkLtSymbol, 0, Button1, setlayout, {0} },
  114. { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
  115. { ClkClientWin, MODKEY, Button1, movemouse, {0} },
  116. { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
  117. { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
  118. { ClkTagBar, 0, Button1, view, {0} },
  119. { ClkTagBar, 0, Button3, toggleview, {0} },
  120. { ClkTagBar, MODKEY, Button1, tag, {0} },
  121. { ClkTagBar, MODKEY, Button3, toggletag, {0} },
  122. { ClkStatusText, 0, Button1, sigdwmblocks, {.i = 1 } },
  123. { ClkStatusText, 0, Button2, sigdwmblocks, {.i = 2 } },
  124. { ClkStatusText, 0, Button3, sigdwmblocks, {.i = 3 } },
  125. { ClkLtSymbol, 0, Button3, layoutmenu, {0} },
  126. };