Browse Source

2020-11-28

master
RinRi 3 years ago
parent
commit
83a970a0ee
29 changed files with 12 additions and 3013 deletions
  1. +0
    -0
      LICENSE
  2. +0
    -0
      Makefile
  3. +0
    -0
      README
  4. +0
    -0
      README.md
  5. +6
    -3
      config.def.h
  6. +0
    -153
      config.def.h.orig
  7. +0
    -17
      config.def.h.rej
  8. +6
    -3
      config.h
  9. +0
    -145
      config.h.orig
  10. +0
    -10
      config.h.rej
  11. +0
    -0
      config.mk
  12. +0
    -38
      config.mk.orig
  13. +0
    -0
      drw.c
  14. +0
    -0
      drw.h
  15. +0
    -0
      drw.o
  16. BIN
      dwm
  17. +0
    -142
      dwm-centeredmaster-6.1.diff
  18. BIN
      dwm-screen.png
  19. +0
    -0
      dwm.1
  20. +0
    -0
      dwm.c
  21. +0
    -2491
      dwm.c.orig
  22. +0
    -11
      dwm.c.rej
  23. BIN
      dwm.o
  24. +0
    -0
      dwm.png
  25. +0
    -0
      patches.txt
  26. +0
    -0
      transient.c
  27. +0
    -0
      util.c
  28. +0
    -0
      util.h
  29. +0
    -0
      util.o

+ 0
- 0
LICENSE View File


+ 0
- 0
Makefile View File


+ 0
- 0
README View File


+ 0
- 0
README.md View File


+ 6
- 3
config.def.h View File

@@ -7,7 +7,7 @@ static const unsigned int snap = 32; /* snap pixel */
static const int swallowfloating = 0; /* 1 means swallow floating windows by default */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { "monospace:size=13", "fontawesome:size=15"};
static const char *fonts[] = { "fontawesome:size=15", "DejaVuSansMono Nerd Font Mono:size=13"} ;
static const char dmenufont[] = "monospace:size=13";
static const char col_gray1[] = "#222222";
static const char col_gray2[] = "#444444";
@@ -79,7 +79,7 @@ static const char *termcmd[] = { "st", NULL };

static Key keys[] = {
/* modifier key function argument */
{ 0, XK_Print, spawn, SHCMD("scrot -e 'mv $f ~/Screenshots'") },
{ 0, XK_Print, spawn, SHCMD("~/scripts/screenshot.sh") },
{ 0, XF86XK_PowerOff, spawn, SHCMD("~/scripts/poweroff.sh") },
{ 0, XF86XK_AudioMute, spawn, SHCMD("pulsemixer --toggle-mute") },
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pulsemixer --change-volume +1") },
@@ -91,13 +91,16 @@ static Key keys[] = {
{ 0, XF86XK_AudioStop, spawn, SHCMD("cmus-remote --stop") },
{ 0, XF86XK_AudioRewind, spawn, SHCMD("cmus-remote --seek -10") },
{ 0, XF86XK_AudioForward, spawn, SHCMD("cmus-remote --seek +10") },
{ 0, XF86XK_MonBrightnessUp, spawn, SHCMD("brightnessctl s +5%")},
{ 0, XF86XK_MonBrightnessDown, spawn, SHCMD("brightnessctl s 5%-")},
{ MODKEY|ShiftMask, XK_space, togglealwaysontop, {0} },
{ MODKEY, XK_w, spawn, SHCMD("firefox") },
{ MODKEY|ShiftMask, XK_l, spawn, SHCMD("slock") },
{ MODKEY|ShiftMask, XK_m, spawn, SHCMD("st ~/scripts/autostart.sh") },
{ MODKEY|ShiftMask, XK_j, spawn, SHCMD("joplin-desktop") },
{ MODKEY|ShiftMask, XK_s, spawn, SHCMD("~/scripts/screenshot.sh 1") },
{ MODKEY|ShiftMask, XK_n, spawn, SHCMD("connman-gtk") },
{ MODKEY|ShiftMask, XK_n, spawn, SHCMD("connman-gtk") },
{ MODKEY|ShiftMask, XK_x, spawn, SHCMD("mixer.sh") },
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} },


+ 0
- 153
config.def.h.orig View File

@@ -1,153 +0,0 @@
/* See LICENSE file for copyright and license details. */

/* appearance */
static const unsigned int borderpx = 2; /* border pixel of windows */
static const unsigned int gappx = 15;
static const unsigned int snap = 32; /* snap pixel */
static const int swallowfloating = 0; /* 1 means swallow floating windows by default */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { "monospace:size=13", "fontawesome:size=15"};
static const char dmenufont[] = "monospace:size=13";
static const char col_gray1[] = "#222222";
static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#eeeeee";
static const char col_cyan[] = "#41008c";
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
};

static const char *const autostart[] = {
"sh", "-c", "sh ~/scripts/xinit.sh", NULL,
"dunst", NULL,
"slstatus", NULL,
NULL /* terminate */
};

/* tagging */
static const char *tags[] = { "", "", "", "", "", "", "", "", "" };

static const Rule rules[] = {
/* xprop(1):
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags mask iscentered isfloating monitor */
{ "Gimp", NULL, NULL, 0, 0, 1, -1 },
{ "Firefox", NULL, NULL, 1 << 8, 0, 0, -1 },
/* class instance title tags mask iscentered isfloating isterminal noswallow monitor */
{ "Gimp", NULL, NULL, 0,0, 1, 0, 0, -1 },
{ "Firefox", NULL, NULL, 1 << 8,0, 0, 0, -1, -1 },
{ "St", NULL, NULL, 0,0, 0, 1, 0, -1 },
{ NULL, NULL, "Event Tester", 0,0, 0, 0, 1, -1 }, /* xev */
};

/* layout(s) */
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster = 1; /* number of clients in master area */
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */

static const Layout layouts[] = {
/* symbol arrange function */
{ "[]=", tile }, /* first entry is default */
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
};

/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },

/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }

/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
static const char *termcmd[] = { "st", NULL };

#include <X11/XF86keysym.h>

static Key keys[] = {
/* modifier key function argument */
{ 0, XK_Print, spawn, SHCMD("scrot -e 'mv $f ~/Screenshots'") },
{ 0, XF86XK_PowerOff, spawn, SHCMD("~/scripts/poweroff.sh") },
{ 0, XF86XK_AudioMute, spawn, SHCMD("pulsemixer --toggle-mute") },
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pulsemixer --change-volume +1") },
{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pulsemixer --change-volume -1") },
{ 0, XF86XK_AudioPrev, spawn, SHCMD("cmus-remote --prev") },
{ 0, XF86XK_AudioNext, spawn, SHCMD("cmus-remote --next") },
{ 0, XF86XK_AudioPause, spawn, SHCMD("cmus-remote --pause") },
{ 0, XF86XK_AudioPlay, spawn, SHCMD("cmus-remote --pause") },
{ 0, XF86XK_AudioStop, spawn, SHCMD("cmus-remote --stop") },
{ 0, XF86XK_AudioRewind, spawn, SHCMD("cmus-remote --seek -10") },
{ 0, XF86XK_AudioForward, spawn, SHCMD("cmus-remote --seek +10") },
{ MODKEY|ShiftMask, XK_space, togglealwaysontop, {0} },
{ MODKEY, XK_w, spawn, SHCMD("firefox") },
{ MODKEY|ShiftMask, XK_l, spawn, SHCMD("slock") },
{ MODKEY|ShiftMask, XK_m, spawn, SHCMD("st ~/scripts/autostart.sh") },
{ MODKEY|ShiftMask, XK_j, spawn, SHCMD("joplin-desktop") },
{ MODKEY|ShiftMask, XK_s, spawn, SHCMD("~/scripts/screenshot.sh 1") },
{ MODKEY|ShiftMask, XK_n, spawn, SHCMD("connman-gtk") },
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
{ MODKEY, XK_minus, setgaps, {.i = -5 } },
{ MODKEY, XK_equal, setgaps, {.i = +5 } },
{ MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
TAGKEYS( XK_4, 3)
TAGKEYS( XK_5, 4)
TAGKEYS( XK_6, 5)
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_q, quit, {0} },
};

/* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
/* click event mask button function argument */
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
{ ClkWinTitle, 0, Button2, zoom, {0} },
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
{ ClkTagBar, 0, Button1, view, {0} },
{ ClkTagBar, 0, Button3, toggleview, {0} },
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};


+ 0
- 17
config.def.h.rej View File

@@ -1,17 +0,0 @@
--- config.def.h
+++ config.def.h
@@ -27,9 +28,11 @@ static const Rule rules[] = {
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
- /* class instance title tags mask isfloating monitor */
- { "Gimp", NULL, NULL, 0, 1, -1 },
- { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
+ /* class instance title tags mask isfloating isterminal noswallow monitor */
+ { "Gimp", NULL, NULL, 0, 1, 0, 0, -1 },
+ { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1, -1 },
+ { "St", NULL, NULL, 0, 0, 1, 0, -1 },
+ { NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */
};
/* layout(s) */

+ 6
- 3
config.h View File

@@ -7,7 +7,7 @@ static const unsigned int snap = 32; /* snap pixel */
static const int swallowfloating = 0; /* 1 means swallow floating windows by default */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { "monospace:size=13", "fontawesome:size=15"};
static const char *fonts[] = { "fontawesome:size=15", "DejaVuSansMono Nerd Font Mono:size=13"} ;
static const char dmenufont[] = "monospace:size=13";
static const char col_gray1[] = "#222222";
static const char col_gray2[] = "#444444";
@@ -79,7 +79,7 @@ static const char *termcmd[] = { "st", NULL };

static Key keys[] = {
/* modifier key function argument */
{ 0, XK_Print, spawn, SHCMD("scrot -e 'mv $f ~/Screenshots'") },
{ 0, XK_Print, spawn, SHCMD("~/scripts/screenshot.sh") },
{ 0, XF86XK_PowerOff, spawn, SHCMD("~/scripts/poweroff.sh") },
{ 0, XF86XK_AudioMute, spawn, SHCMD("pulsemixer --toggle-mute") },
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pulsemixer --change-volume +1") },
@@ -91,13 +91,16 @@ static Key keys[] = {
{ 0, XF86XK_AudioStop, spawn, SHCMD("cmus-remote --stop") },
{ 0, XF86XK_AudioRewind, spawn, SHCMD("cmus-remote --seek -10") },
{ 0, XF86XK_AudioForward, spawn, SHCMD("cmus-remote --seek +10") },
{ 0, XF86XK_MonBrightnessUp, spawn, SHCMD("brightnessctl s +5%")},
{ 0, XF86XK_MonBrightnessDown, spawn, SHCMD("brightnessctl s 5%-")},
{ MODKEY|ShiftMask, XK_space, togglealwaysontop, {0} },
{ MODKEY, XK_w, spawn, SHCMD("firefox") },
{ MODKEY|ShiftMask, XK_l, spawn, SHCMD("slock") },
{ MODKEY|ShiftMask, XK_m, spawn, SHCMD("st ~/scripts/autostart.sh") },
{ MODKEY|ShiftMask, XK_j, spawn, SHCMD("joplin-desktop") },
{ MODKEY|ShiftMask, XK_s, spawn, SHCMD("~/scripts/screenshot.sh 1") },
{ MODKEY|ShiftMask, XK_n, spawn, SHCMD("connman-gtk") },
{ MODKEY|ShiftMask, XK_n, spawn, SHCMD("connman-gtk") },
{ MODKEY|ShiftMask, XK_x, spawn, SHCMD("mixer.sh") },
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} },


+ 0
- 145
config.h.orig View File

@@ -1,145 +0,0 @@
/* See LICENSE file for copyright and license details. */

/* appearance */
static const unsigned int borderpx = 2; /* border pixel of windows */
static const unsigned int gappx = 15;
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { "monospace:size=13", "fontawesome:size=15"};
static const char dmenufont[] = "monospace:size=13";
static const char col_gray1[] = "#222222";
static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#eeeeee";
static const char col_cyan[] = "#41008c";
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
};

static const char *const autostart[] = {
"sh", "-c", "sh ~/scripts/xinit.sh", NULL,
"dunst", NULL,
"slstatus", NULL,
NULL /* terminate */
};

/* tagging */
static const char *tags[] = { "", "", "", "", "", "", "" };

static const Rule rules[] = {
/* xprop(1):
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags mask iscentered isfloating monitor */
{ "Gimp", NULL, NULL, 0, 0, 1, -1 },
{ "Firefox", NULL, NULL, 1 << 8, 0, 0, -1 },
};

/* layout(s) */
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
static const int nmaster = 1; /* number of clients in master area */
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */

static const Layout layouts[] = {
/* symbol arrange function */
{ "[]=", tile }, /* first entry is default */
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
};

/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },

/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }

/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
static const char *termcmd[] = { "st", NULL };

#include <X11/XF86keysym.h>

static Key keys[] = {
/* modifier key function argument */
{ 0, XF86XK_PowerOff, spawn, SHCMD("~/scripts/poweroff.sh") },
{ 0, XF86XK_AudioMute, spawn, SHCMD("pulsemixer --toggle-mute") },
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pulsemixer --change-volume +1") },
{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pulsemixer --change-volume -1") },
{ 0, XF86XK_AudioPrev, spawn, SHCMD("cmus-remote --prev") },
{ 0, XF86XK_AudioNext, spawn, SHCMD("cmus-remote --next") },
{ 0, XF86XK_AudioPause, spawn, SHCMD("cmus-remote --pause") },
{ 0, XF86XK_AudioPlay, spawn, SHCMD("cmus-remote --pause") },
{ 0, XF86XK_AudioStop, spawn, SHCMD("cmus-remote --stop") },
{ 0, XF86XK_AudioRewind, spawn, SHCMD("cmus-remote --seek -10") },
{ 0, XF86XK_AudioForward, spawn, SHCMD("cmus-remote --seek +10") },
{ MODKEY, XK_w, spawn, SHCMD("firefox") },
{ MODKEY|ShiftMask, XK_l, spawn, SHCMD("xsecurelock") },
{ MODKEY|ShiftMask, XK_m, spawn, SHCMD("st ~/scripts/autostart.sh") },
{ MODKEY|ShiftMask, XK_j, spawn, SHCMD("joplin-desktop") },
{ MODKEY|ShiftMask, XK_s, spawn, SHCMD("deepin-screenshot") },
{ MODKEY|ShiftMask, XK_n, spawn, SHCMD("networkmanager_dmenu") },
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
{ MODKEY, XK_minus, setgaps, {.i = -5 } },
{ MODKEY, XK_equal, setgaps, {.i = +5 } },
{ MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
TAGKEYS( XK_4, 3)
TAGKEYS( XK_5, 4)
TAGKEYS( XK_6, 5)
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_q, quit, {0} },
};

/* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = {
/* click event mask button function argument */
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
{ ClkWinTitle, 0, Button2, zoom, {0} },
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
{ ClkTagBar, 0, Button1, view, {0} },
{ ClkTagBar, 0, Button3, toggleview, {0} },
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};


+ 0
- 10
config.h.rej View File

@@ -1,10 +0,0 @@
--- config.h
+++ config.h
@@ -178,6 +178,7 @@ static Key keys[] = {
{ MODKEY, XK_e, setlayout, {.v = &layouts[LAYOUT_I_grid]} },
{ MODKEY, XK_space, togglefloating, {0} },
+ { MODKEY|ShiftMask, XK_space, togglealwaysontop, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },

+ 0
- 0
config.mk View File


+ 0
- 38
config.mk.orig View File

@@ -1,38 +0,0 @@
# dwm version
VERSION = 6.2

# Customize below to fit your system

# paths
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man

X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib

# Xinerama, comment if you don't want it
XINERAMALIBS = -lXinerama
XINERAMAFLAGS = -DXINERAMA

# freetype
FREETYPELIBS = -lfontconfig -lXft
FREETYPEINC = /usr/include/freetype2
# OpenBSD (uncomment)
#FREETYPEINC = ${X11INC}/freetype2

# includes and libs
INCS = -I${X11INC} -I${FREETYPEINC}
LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS}

# flags
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS}
LDFLAGS = ${LIBS}

# Solaris
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
#LDFLAGS = ${LIBS}

# compiler and linker
CC = cc

+ 0
- 0
drw.c View File


+ 0
- 0
drw.h View File


+ 0
- 0
drw.o View File


BIN
dwm View File


+ 0
- 142
dwm-centeredmaster-6.1.diff View File

@@ -1,142 +0,0 @@
diff --git a/config.def.h b/config.def.h
index 7054c06..527b214 100644
--- a/config.def.h
+++ b/config.def.h
@@ -39,6 +39,8 @@ static const Layout layouts[] = {
{ "[]=", tile }, /* first entry is default */
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
+ { "|M|", centeredmaster },
+ { ">M>", centeredfloatingmaster },
};
/* key definitions */
@@ -74,6 +76,8 @@ static Key keys[] = {
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
+ { MODKEY, XK_u, setlayout, {.v = &layouts[3]} },
+ { MODKEY, XK_o, setlayout, {.v = &layouts[4]} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
diff --git a/dwm.c b/dwm.c
index 0362114..1e81412 100644
--- a/dwm.c
+++ b/dwm.c
@@ -233,6 +233,8 @@ static int xerror(Display *dpy, XErrorEvent *ee);
static int xerrordummy(Display *dpy, XErrorEvent *ee);
static int xerrorstart(Display *dpy, XErrorEvent *ee);
static void zoom(const Arg *arg);
+static void centeredmaster(Monitor *m);
+static void centeredfloatingmaster(Monitor *m);
/* variables */
static const char broken[] = "broken";
@@ -2139,3 +2141,106 @@ main(int argc, char *argv[])
XCloseDisplay(dpy);
return EXIT_SUCCESS;
}
+
+void
+centeredmaster(Monitor *m)
+{
+ unsigned int i, n, h, mw, mx, my, oty, ety, tw;
+ Client *c;
+
+ /* count number of clients in the selected monitor */
+ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+ if (n == 0)
+ return;
+
+ /* initialize areas */
+ mw = m->ww;
+ mx = 0;
+ my = 0;
+ tw = mw;
+
+ if (n > m->nmaster) {
+ /* go mfact box in the center if more than nmaster clients */
+ mw = m->nmaster ? m->ww * m->mfact : 0;
+ tw = m->ww - mw;
+
+ if (n - m->nmaster > 1) {
+ /* only one client */
+ mx = (m->ww - mw) / 2;
+ tw = (m->ww - mw) / 2;
+ }
+ }
+
+ oty = 0;
+ ety = 0;
+ for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
+ if (i < m->nmaster) {
+ /* nmaster clients are stacked vertically, in the center
+ * of the screen */
+ h = (m->wh - my) / (MIN(n, m->nmaster) - i);
+ resize(c, m->wx + mx, m->wy + my, mw - (2*c->bw),
+ h - (2*c->bw), 0);
+ my += HEIGHT(c);
+ } else {
+ /* stack clients are stacked vertically */
+ if ((i - m->nmaster) % 2 ) {
+ h = (m->wh - ety) / ( (1 + n - i) / 2);
+ resize(c, m->wx, m->wy + ety, tw - (2*c->bw),
+ h - (2*c->bw), 0);
+ ety += HEIGHT(c);
+ } else {
+ h = (m->wh - oty) / ((1 + n - i) / 2);
+ resize(c, m->wx + mx + mw, m->wy + oty,
+ tw - (2*c->bw), h - (2*c->bw), 0);
+ oty += HEIGHT(c);
+ }
+ }
+}
+
+void
+centeredfloatingmaster(Monitor *m)
+{
+ unsigned int i, n, w, mh, mw, mx, mxo, my, myo, tx;
+ Client *c;
+
+ /* count number of clients in the selected monitor */
+ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+ if (n == 0)
+ return;
+
+ /* initialize nmaster area */
+ if (n > m->nmaster) {
+ /* go mfact box in the center if more than nmaster clients */
+ if (m->ww > m->wh) {
+ mw = m->nmaster ? m->ww * m->mfact : 0;
+ mh = m->nmaster ? m->wh * 0.9 : 0;
+ } else {
+ mh = m->nmaster ? m->wh * m->mfact : 0;
+ mw = m->nmaster ? m->ww * 0.9 : 0;
+ }
+ mx = mxo = (m->ww - mw) / 2;
+ my = myo = (m->wh - mh) / 2;
+ } else {
+ /* go fullscreen if all clients are in the master area */
+ mh = m->wh;
+ mw = m->ww;
+ mx = mxo = 0;
+ my = myo = 0;
+ }
+
+ for(i = tx = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
+ if (i < m->nmaster) {
+ /* nmaster clients are stacked horizontally, in the center
+ * of the screen */
+ w = (mw + mxo - mx) / (MIN(n, m->nmaster) - i);
+ resize(c, m->wx + mx, m->wy + my, w - (2*c->bw),
+ mh - (2*c->bw), 0);
+ mx += WIDTH(c);
+ } else {
+ /* stack clients are stacked horizontally */
+ w = (m->ww - tx) / (n - i);
+ resize(c, m->wx + tx, m->wy, w - (2*c->bw),
+ m->wh - (2*c->bw), 0);
+ tx += WIDTH(c);
+ }
+}

BIN
dwm-screen.png View File

Before After
Width: 1920  |  Height: 1080  |  Size: 866 KiB Width: 1920  |  Height: 1080  |  Size: 835 KiB

+ 0
- 0
dwm.1 View File


+ 0
- 0
dwm.c View File


+ 0
- 2491
dwm.c.orig
File diff suppressed because it is too large
View File


+ 0
- 11
dwm.c.rej View File

@@ -1,11 +0,0 @@
--- dwm.c
+++ dwm.c
@@ -233,6 +233,8 @@ static int xerror(Display *dpy, XErrorEvent *ee);
static int xerrordummy(Display *dpy, XErrorEvent *ee);
static int xerrorstart(Display *dpy, XErrorEvent *ee);
static void zoom(const Arg *arg);
+static void centeredmaster(Monitor *m);
+static void centeredfloatingmaster(Monitor *m);
/* variables */
static const char broken[] = "broken";

BIN
dwm.o View File


+ 0
- 0
dwm.png View File

Before After
Width: 192  |  Height: 80  |  Size: 373 B Width: 192  |  Height: 80  |  Size: 373 B

+ 0
- 0
patches.txt View File


+ 0
- 0
transient.c View File


+ 0
- 0
util.c View File


+ 0
- 0
util.h View File


+ 0
- 0
util.o View File


Loading…
Cancel
Save