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.

73 lines
2.5 KiB

4 years ago
  1. diff -r 050d521d66d8 config.def.h
  2. --- a/config.def.h Tue Aug 24 13:13:20 2010 +0100
  3. +++ b/config.def.h Sun Sep 05 18:43:07 2010 +0200
  4. @@ -57,6 +57,7 @@
  5. static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
  6. static const char *termcmd[] = { "st", NULL };
  7. +#include "movestack.c"
  8. static Key keys[] = {
  9. /* modifier key function argument */
  10. { MODKEY, XK_p, spawn, {.v = dmenucmd } },
  11. @@ -68,6 +69,8 @@
  12. { MODKEY, XK_d, incnmaster, {.i = -1 } },
  13. { MODKEY, XK_h, setmfact, {.f = -0.05} },
  14. { MODKEY, XK_l, setmfact, {.f = +0.05} },
  15. + { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } },
  16. + { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } },
  17. { MODKEY, XK_Return, zoom, {0} },
  18. { MODKEY, XK_Tab, view, {0} },
  19. { MODKEY|ShiftMask, XK_c, killclient, {0} },
  20. diff -r 050d521d66d8 movestack.c
  21. --- /dev/null Thu Jan 01 00:00:00 1970 +0000
  22. +++ b/movestack.c Sun Sep 05 18:43:07 2010 +0200
  23. @@ -0,0 +1,49 @@
  24. +void
  25. +movestack(const Arg *arg) {
  26. + Client *c = NULL, *p = NULL, *pc = NULL, *i;
  27. +
  28. + if(arg->i > 0) {
  29. + /* find the client after selmon->sel */
  30. + for(c = selmon->sel->next; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
  31. + if(!c)
  32. + for(c = selmon->clients; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
  33. +
  34. + }
  35. + else {
  36. + /* find the client before selmon->sel */
  37. + for(i = selmon->clients; i != selmon->sel; i = i->next)
  38. + if(ISVISIBLE(i) && !i->isfloating)
  39. + c = i;
  40. + if(!c)
  41. + for(; i; i = i->next)
  42. + if(ISVISIBLE(i) && !i->isfloating)
  43. + c = i;
  44. + }
  45. + /* find the client before selmon->sel and c */
  46. + for(i = selmon->clients; i && (!p || !pc); i = i->next) {
  47. + if(i->next == selmon->sel)
  48. + p = i;
  49. + if(i->next == c)
  50. + pc = i;
  51. + }
  52. +
  53. + /* swap c and selmon->sel selmon->clients in the selmon->clients list */
  54. + if(c && c != selmon->sel) {
  55. + Client *temp = selmon->sel->next==c?selmon->sel:selmon->sel->next;
  56. + selmon->sel->next = c->next==selmon->sel?c:c->next;
  57. + c->next = temp;
  58. +
  59. + if(p && p != c)
  60. + p->next = c;
  61. + if(pc && pc != selmon->sel)
  62. + pc->next = selmon->sel;
  63. +
  64. + if(selmon->sel == selmon->clients)
  65. + selmon->clients = c;
  66. + else if(c == selmon->clients)
  67. + selmon->clients = selmon->sel;
  68. +
  69. + arrange(selmon);
  70. + }
  71. +}
  72. +