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.

47 lines
1.1 KiB

4 years ago
  1. diff -urp dwm-6.1/dwm.c dwm-6.1-patched/dwm.c
  2. --- dwm-6.1/dwm.c 2015-11-09 06:39:37.000000000 +0800
  3. +++ dwm-6.1-patched/dwm.c 2016-03-24 23:56:35.435047948 +0800
  4. @@ -206,6 +206,7 @@ static void setup(void);
  5. static void showhide(Client *c);
  6. static void sigchld(int unused);
  7. static void spawn(const Arg *arg);
  8. +static void switchcol(const Arg *arg);
  9. static void tag(const Arg *arg);
  10. static void tagmon(const Arg *arg);
  11. static void tile(Monitor *);
  12. @@ -1645,6 +1646,35 @@ spawn(const Arg *arg)
  13. }
  14. }
  15. +void
  16. +switchcol(const Arg *arg)
  17. +{
  18. + Client *c, *t;
  19. + int col = 0;
  20. + int i;
  21. +
  22. + if (!selmon->sel)
  23. + return;
  24. + for (i = 0, c = nexttiled(selmon->clients); c ;
  25. + c = nexttiled(c->next), i++) {
  26. + if (c == selmon->sel)
  27. + col = (i + 1) > selmon->nmaster;
  28. + }
  29. + if (i <= selmon->nmaster)
  30. + return;
  31. + for (c = selmon->stack; c; c = c->snext) {
  32. + if (!ISVISIBLE(c))
  33. + continue;
  34. + for (i = 0, t = nexttiled(selmon->clients); t && t != c;
  35. + t = nexttiled(t->next), i++);
  36. + if (t && (i + 1 > selmon->nmaster) != col) {
  37. + focus(c);
  38. + restack(selmon);
  39. + break;
  40. + }
  41. + }
  42. +}
  43. +
  44. void
  45. tag(const Arg *arg)
  46. {