diff options
author | zachir <zachir@librem.one> | 2021-08-25 11:08:51 -0500 |
---|---|---|
committer | zachir <zachir@librem.one> | 2021-08-25 11:08:51 -0500 |
commit | 2b45b638655b3e4217184b6e192219e787956dd4 (patch) | |
tree | 5bdef375a303f545359787baa037f40c8b563251 | |
parent | 1f34a1985d7be82589b10ad279a2d1143ceffec8 (diff) |
Revert to 6.2 + patches, rather than arbitrary git version
-rw-r--r-- | drw.c | 1 | ||||
-rw-r--r-- | dwm-zir-6.2.diff (renamed from patch.diff) | 1017 | ||||
-rw-r--r-- | dwm.1 | 154 | ||||
-rw-r--r-- | dwm.c | 146 |
4 files changed, 728 insertions, 590 deletions
@@ -95,7 +95,6 @@ drw_free(Drw *drw) { XFreePixmap(drw->dpy, drw->drawable); XFreeGC(drw->dpy, drw->gc); - drw_fontset_free(drw->fonts); free(drw); } diff --git a/patch.diff b/dwm-zir-6.2.diff index a6ea385..779d950 100644 --- a/patch.diff +++ b/dwm-zir-6.2.diff @@ -1,30 +1,18 @@ diff --git a/Makefile b/Makefile -index 77bcbc0..c6bc24b 100644 +index 77bcbc0..f837f5c 100644 --- a/Makefile +++ b/Makefile -@@ -37,8 +37,9 @@ dist: clean - rm -rf dwm-${VERSION} +@@ -38,7 +38,7 @@ dist: clean install: all -- mkdir -p ${DESTDIR}${PREFIX}/bin + mkdir -p ${DESTDIR}${PREFIX}/bin - cp -f dwm ${DESTDIR}${PREFIX}/bin -+ mkdir -p ${DESTDIR}${PREFIX}/bin ${DESTDIR}${XSESSIONPREFIX} -+ cp -f dwm dwmc volsv ${DESTDIR}${PREFIX}/bin -+ cp -f dwm.desktop ${DESTDIR}${XSESSIONPREFIX} ++ cp -f dwm dwmc ${DESTDIR}${PREFIX}/bin chmod 755 ${DESTDIR}${PREFIX}/bin/dwm mkdir -p ${DESTDIR}${MANPREFIX}/man1 sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1 -@@ -46,6 +47,8 @@ install: all - - uninstall: - rm -f ${DESTDIR}${PREFIX}/bin/dwm\ -+ ${DESTDIR}${PREFIX}/bin/dwmc\ -+ ${DESTDIR}${PREFIX}/bin/volsv\ - ${DESTDIR}${MANPREFIX}/man1/dwm.1 - - .PHONY: all options clean dist install uninstall diff --git a/config.def.h b/config.def.h -index 1c0b587..9b6eba9 100644 +index 1c0b587..a66fbe2 100644 --- a/config.def.h +++ b/config.def.h @@ -2,7 +2,13 @@ @@ -61,7 +49,7 @@ index 1c0b587..9b6eba9 100644 /* tagging */ static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; -@@ -26,15 +45,21 @@ static const Rule rules[] = { +@@ -26,21 +45,29 @@ static const Rule rules[] = { * WM_CLASS(STRING) = instance, class * WM_NAME(STRING) = title */ @@ -84,9 +72,17 @@ index 1c0b587..9b6eba9 100644 static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ +static int attachbelow = 1; /* 1 means attach after the currently active window */ ++#include "tcl.c" static const Layout layouts[] = { /* symbol arrange function */ -@@ -59,6 +84,7 @@ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() + { "[]=", tile }, /* first entry is default */ + { "><>", NULL }, /* no layout function means floating behavior */ + { "[M]", monocle }, ++ { "|||", tcl }, + }; + + /* key definitions */ +@@ -59,6 +86,7 @@ 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 }; @@ -94,7 +90,7 @@ index 1c0b587..9b6eba9 100644 static Key keys[] = { /* modifier key function argument */ { MODKEY, XK_p, spawn, {.v = dmenucmd } }, -@@ -70,6 +96,9 @@ static Key keys[] = { +@@ -70,20 +98,28 @@ static Key keys[] = { { MODKEY, XK_d, incnmaster, {.i = -1 } }, { MODKEY, XK_h, setmfact, {.f = -0.05} }, { MODKEY, XK_l, setmfact, {.f = +0.05} }, @@ -104,8 +100,10 @@ index 1c0b587..9b6eba9 100644 { MODKEY, XK_Return, zoom, {0} }, { MODKEY, XK_Tab, view, {0} }, { MODKEY|ShiftMask, XK_c, killclient, {0} }, -@@ -78,12 +107,16 @@ 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|ShiftMask, XK_t, setlayout, {.v = &layouts[3]} }, { MODKEY, XK_space, setlayout, {0} }, { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, + { MODKEY|ShiftMask, XK_f, togglefullscr, {0} }, @@ -121,7 +119,7 @@ index 1c0b587..9b6eba9 100644 TAGKEYS( XK_1, 0) TAGKEYS( XK_2, 1) TAGKEYS( XK_3, 2) -@@ -94,6 +127,7 @@ static Key keys[] = { +@@ -94,6 +130,7 @@ static Key keys[] = { TAGKEYS( XK_8, 7) TAGKEYS( XK_9, 8) { MODKEY|ShiftMask, XK_q, quit, {0} }, @@ -129,7 +127,7 @@ index 1c0b587..9b6eba9 100644 }; /* button definitions */ -@@ -103,13 +137,85 @@ static Button buttons[] = { +@@ -103,13 +140,85 @@ static Button buttons[] = { { ClkLtSymbol, 0, Button1, setlayout, {0} }, { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, { ClkWinTitle, 0, Button2, zoom, {0} }, @@ -217,19 +215,318 @@ index 1c0b587..9b6eba9 100644 + { "setlayout", setlayout }, + { "setlayoutex", setlayoutex }, +}; +diff --git a/config.h b/config.h +new file mode 100644 +index 0000000..e37feca +--- /dev/null ++++ b/config.h +@@ -0,0 +1,301 @@ ++/* See LICENSE file for copyright and license details. */ ++ ++#include <X11/XF86keysym.h> ++ ++/* appearance */ ++static const unsigned int borderpx = 1; /* border pixel of windows */ ++static const unsigned int gappx = 6; /* gaps between windows */ ++static const unsigned int snap = 32; /* snap pixel */ ++static const int swallowfloating = 0; ++static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */ ++static const unsigned int systrayspacing = 2; /* systray spacing */ ++static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/ ++static const int showsystray = 1; /* 0 means no systray */ ++static const int showbar = 1; /* 0 means no bar */ ++static const int topbar = 1; /* 0 means bottom bar */ ++static const char *fonts[] = { "mononoki Nerd Font Mono:size=10", "JoyPixels:size=9" }; ++static const char dmenufont[] = "mononoki Nerd Font Mono:size=10"; ++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[] = "#750000"; ++static const char *colors[][3] = { ++ /* fg bg border */ ++ [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, ++ [SchemeSel] = { col_gray4, col_cyan, col_cyan }, ++}; ++ ++typedef struct { ++ const char *name; ++ const void *cmd; ++} Sp; ++const char *spcmd1[] = { "st", "-g", "150x50", "-c", "sphtop", "-e", "htop", NULL }; ++const char *spcmd2[] = { "st", "-g", "150x50", "-c", "spterm", NULL }; ++const char *spcmd3[] = { "st", "-g", "150x50", "-c", "sppm", "-e", "pulsemixer", NULL }; ++const char *spcmd4[] = { "st", "-g", "150x50", "-c", "spncmp", "-e", "ncmpcpp", NULL }; ++const char *spcmd5[] = { "st", "-g", "150x50", "-c", "spmutt", "-e", "neomutt", NULL }; ++const char *spcmd6[] = { "st", "-g", "150x50", "-c", "spping", "-e", "ping", "1.1.1.1", NULL }; ++static Sp scratchpads[] = { ++ { "sphtop", spcmd1 }, ++ { "spterm", spcmd2 }, ++ { "sppm", spcmd3 }, ++ { "spncmp", spcmd4 }, ++ { "spmutt", spcmd5 }, ++ { "spping", spcmd6 }, ++}; ++ ++/* tagging */ ++static const char *tags[] = { " 1", " 2", " 3", " 4", " 5", " 6", " 7", " 8", " 9" }; ++ ++static const Rule rules[] = { ++ /* xprop(1): ++ * WM_CLASS(STRING) = instance, class ++ * WM_NAME(STRING) = title ++ */ ++ /* class instance title tags mask isfloating isterminal noswallow monitor */ ++ { NULL, NULL,"Picture in picture", 511, 1, 0, 0, -1 }, ++ { "ardour-6.2.0",NULL, NULL, 0, 1, 0, 0, -1 }, ++ { "urxvt", NULL, NULL, 0, 0, 1, 0, -1 }, ++ { "URxvt", NULL, NULL, 0, 0, 1, 0, -1 }, ++ { "Ardour-6.2.0",NULL, NULL, 0, 1, 0, 0, -1 }, ++ { "Gimp", NULL, NULL, 0, 1, 0, 0, -1 }, ++ { "st-256color",NULL, NULL, 0, 0, 1, 1, -1 }, ++ { "st", NULL, NULL, 0, 0, 1, 1, -1 }, ++ { "St", NULL, NULL, 0, 0, 1, 1, -1 }, ++ { "tabbed", NULL, NULL, 0, 0, 1, 0, -1 }, ++ { NULL, NULL, "abduco", 0, 0, 1, 0, -1 }, ++ { "Alacritty", NULL, NULL, 0, 0, 1, 0, -1 }, ++ { "Blueman", NULL, NULL, 0, 1, 0, 0, -1 }, ++ { "QjackCtl", NULL, NULL, 0, 1, 0, 0, -1 }, ++ { "qjackctl", NULL, NULL, 0, 1, 0, 0, -1 }, ++ { "catia.py", NULL, NULL, 0, 1, 0, 0, -1 }, ++ { "Catia", NULL, NULL, 0, 1, 0, 0, -1 }, ++ { NULL, "carla",NULL, 1 << 7, 1, 0, 0, -1 }, ++ { NULL, NULL, "Event Tester", 0, 1, 0, 1, -1 }, ++ { "Steam", NULL, NULL, 4, 0, 0, 0, -1 }, ++ { "steam", NULL, NULL, 4, 0, 0, 0, -1 }, ++ { NULL, NULL, "steam", 4, 0, 0, 0, -1 }, ++ { "Lutris", NULL, NULL, 2, 0, 0, 0, -1 }, ++ { "lutris", NULL, NULL, 2, 0, 0, 0, -1 }, ++ { "sphtop", NULL, NULL, SPTAG(0), 1, 1, 1, -1 }, ++ { "spterm", NULL, NULL, SPTAG(1), 1, 1, 1, -1 }, ++ { "sppm", NULL, NULL, SPTAG(2), 1, 1, 1, -1 }, ++ { "spncmp", NULL, NULL, SPTAG(3), 1, 1, 1, -1 }, ++ { "spmutt", NULL, NULL, SPTAG(4), 1, 1, 1, -1 }, ++ { "spping", NULL, NULL, SPTAG(5), 1, 1, 1, -1 }, ++ { NULL, "monero-wallet-gui",NULL, 256, 1, 0, 0, -1 }, ++}; ++ ++/* layout(s) */ ++static const float mfact = 0.50; /* 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 int attachbelow = 1; /* 1 means attach after the currently active window */ ++ ++#include "tcl.c" ++static const Layout layouts[] = { ++ /* symbol arrange function */ ++ { "[]=", tile }, /* first entry is default */ ++ { "><>", NULL }, /* no layout function means floating behavior */ ++ { "[M]", monocle }, ++ { "|||", tcl }, ++}; ++ ++/* key definitions */ ++#define MODKEY Mod3Mask ++#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 *rmenucmd[] = { "/usr/sbin/j4-dmenu-desktop", NULL }; */ ++/* static const char *passmenu[] = { "passmenu", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; */ ++static const char *termcmd[] = { "urxvtc", NULL }; ++/* static const char *termcmd[] = { "alacritty", NULL }; */ ++static const char *sxhkdsig[] = { "pkill", "-USR1", "sxhkd", NULL }; ++/* static const char *mpdtoggle[] = { "playerctl", "--player=mpd,mpv,%any", "play-pause", NULL }; */ ++/* static const char *mpdnext[] = { "playerctl", "--player=mpd,mpv,%any", "next", NULL }; */ ++/* static const char *mpdprev[] = { "playerctl", "--player=mpd,mpv,%any", "previous", NULL }; */ ++/* static const char *plytoggle[] = { "playerctl", "--player=%any,mpd", "play-pause", NULL }; */ ++/* static const char *plyfwd[] = { "playerctl", "--player=%any,mpd", "position 5+", NULL }; */ ++/* static const char *plybck[] = { "playerctl", "--player=%any,mpd", "position 5-", NULL }; */ ++/* static const char *blightup[] = { "light", "-A", "1", NULL }; */ ++/* static const char *blightdown[] = { "light", "-U", "1", NULL }; */ ++/* static const char *audioup[] = { "volsv", "-i", NULL }; */ ++/* static const char *audiodown[] = { "volsv", "-d", NULL }; */ ++/* static const char *audiomute[] = { "volsv", "-t", NULL }; */ ++/* static const char *micmute[] = { "pamixer", "--source", "1", "-t", NULL }; */ ++/* static const char *lockscr[] = { "xscreensaver-command", "-lock", NULL }; */ ++/* static const char *xidletog[] = { "xidletog", NULL }; */ ++/* static const char *xkillcmd[] = { "xkill", NULL }; */ ++ ++static Key keys[] = { ++ /* modifier key function argument */ ++ /* { MODKEY, XK_d, spawn, {.v = dmenucmd } }, */ ++ /* { MODKEY, XK_r, spawn, {.v = rmenucmd } }, */ ++ /* { MODKEY, XK_p, spawn, {.v = passmenu } }, */ ++ /* { MODKEY, XK_c, spawn, {.v = xidletog } }, */ ++ /* { MODKEY, XK_x, spawn, {.v = xkillcmd } }, */ ++ { MODKEY, XK_Return, spawn, {.v = termcmd } }, ++ { MODKEY|ControlMask, XK_z, togglescratch, {.ui = 0 } }, ++ { MODKEY|ControlMask, XK_x, togglescratch, {.ui = 1 } }, ++ { MODKEY|ControlMask, XK_c, togglescratch, {.ui = 2 } }, ++ { MODKEY|ControlMask, XK_b, togglescratch, {.ui = 3 } }, ++ { MODKEY|ControlMask, XK_a, togglescratch, {.ui = 4 } }, ++ { MODKEY|ControlMask, XK_s, togglescratch, {.ui = 5 } }, ++ { MODKEY, XK_Escape, spawn, {.v = sxhkdsig } }, ++ // { 0, XF86XK_AudioPlay, spawn, {.v = mpdtoggle } }, ++ // { 0, XF86XK_AudioNext, spawn, {.v = mpdnext } }, ++ // { 0, XF86XK_AudioPrev, spawn, {.v = mpdprev } }, ++ // { ShiftMask, XF86XK_AudioPlay, spawn, {.v = plytoggle } }, ++ // { ShiftMask, XF86XK_AudioNext, spawn, {.v = plyfwd } }, ++ // { ShiftMask, XF86XK_AudioPrev, spawn, {.v = plybck } }, ++ // { 0, XF86XK_MonBrightnessUp, spawn, {.v = blightup } }, ++ // { 0, XF86XK_MonBrightnessDown, spawn, {.v = blightdown } }, ++ // { 0, XF86XK_AudioLowerVolume, spawn, {.v = audiodown } }, ++ // { 0, XF86XK_AudioRaiseVolume, spawn, {.v = audioup } }, ++ // { 0, XF86XK_AudioMute, spawn, {.v = audiomute } }, ++ // { 0, XF86XK_AudioMicMute, spawn, {.v = micmute } }, ++ // { Mod4Mask, XK_l, spawn, {.v = lockscr } }, ++ { MODKEY, XK_b, togglebar, {0} }, ++ { MODKEY, XK_j, focusstack, {.i = +1 } }, ++ { MODKEY, XK_k, focusstack, {.i = -1 } }, ++ { MODKEY|ShiftMask, XK_j, pushdown, {.i = +1 } }, ++ { MODKEY|ShiftMask, XK_k, pushup, {.i = -1 } }, ++ { MODKEY|ControlMask, XK_k, setcfact, {.f = +0.25} }, ++ { MODKEY|ControlMask, XK_j, setcfact, {.f = -0.25} }, ++ { MODKEY|ControlMask, XK_o, setcfact, {.f = 0.00} }, ++ { MODKEY|ShiftMask, XK_h, incnmaster, {.i = +1 } }, ++ { MODKEY|ShiftMask, XK_l, incnmaster, {.i = -1 } }, ++ { MODKEY, XK_h, setmfact, {.f = -0.05} }, ++ { MODKEY, XK_l, setmfact, {.f = +0.05} }, ++ { MODKEY|ShiftMask, XK_Return, zoom, {0} }, ++ { MODKEY, XK_Tab, view, {0} }, ++ { MODKEY|ShiftMask, XK_q, killclient, {0} }, ++ { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, ++ { MODKEY, XK_s, setlayout, {.v = &layouts[1]} }, ++ { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, ++ { MODKEY, XK_e, setlayout, {.v = &layouts[3]} }, ++ /* { MODKEY|ShiftMask, XK_space, setlayout, {-1} }, */ ++ { MODKEY, XK_space, togglefloating, {0} }, ++ { MODKEY, XK_f, togglefullscr, {0} }, ++ { MODKEY, XK_0, view, {.ui = ~0 } }, ++ { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, ++ { MODKEY|ControlMask, XK_comma, focusmon, {.i = -1 } }, ++ { MODKEY|ControlMask, XK_period, focusmon, {.i = +1 } }, ++ { MODKEY|ControlMask|ShiftMask, XK_comma, tagmon, {.i = -1 } }, ++ { MODKEY|ControlMask|ShiftMask, XK_period, tagmon, {.i = +1 } }, ++ 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_e, quit, {0} }, ++ { MODKEY|ShiftMask, XK_r, quit, {1} }, ++ { MODKEY|ShiftMask, XK_Tab, toggleAttachBelow, {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, Button1, sigdwmblocks, {.i = 1} }, ++ { ClkStatusText, 0, Button2, sigdwmblocks, {.i = 2} }, ++ { ClkStatusText, 0, Button3, sigdwmblocks, {.i = 3} }, ++ { 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} }, ++}; ++ ++void ++setlayoutex(const Arg *arg) ++{ ++ setlayout(&((Arg) { .v = &layouts[arg->i] })); ++} ++ ++void ++viewex(const Arg *arg) ++{ ++ view(&((Arg) { .ui = 1 << arg->ui })); ++} ++ ++void ++viewall(const Arg *arg) ++{ ++ view(&((Arg){.ui = ~0})); ++} ++ ++void ++toggleviewex(const Arg *arg) ++{ ++ toggleview(&((Arg) { .ui = 1 << arg->ui })); ++} ++ ++void ++tagex(const Arg *arg) ++{ ++ tag(&((Arg) { .ui = 1 << arg->ui })); ++} ++ ++void ++toggletagex(const Arg *arg) ++{ ++ toggletag(&((Arg) { .ui = 1 << arg->ui })); ++} ++ ++void ++tagall(const Arg *arg) ++{ ++ tag(&((Arg){.ui = ~0})); ++} ++ ++/* signal definitions */ ++/* signum must be greater than 0 */ ++/* trigger signals using `xsetroot -name "fsignal:<signame> [<type> <value>]"` */ ++static Signal signals[] = { ++ /* signum function */ ++ { "togglescratch", togglescratch }, ++ { "focusstack", focusstack }, ++ { "setmfact", setmfact }, ++ { "togglebar", togglebar }, ++ { "incnmaster", incnmaster }, ++ { "togglefloating", togglefloating }, ++ { "togglefullscr", togglefullscr }, ++ { "focusmon", focusmon }, ++ { "tagmon", tagmon }, ++ { "zoom", zoom }, ++ { "view", view }, ++ { "viewall", viewall }, ++ { "viewex", viewex }, ++ { "toggleview", view }, ++ { "toggleviewex", toggleviewex }, ++ { "tag", tag }, ++ { "tagall", tagall }, ++ { "tagex", tagex }, ++ { "toggletag", tag }, ++ { "toggletagex", toggletagex }, ++ { "killclient", killclient }, ++ { "quit", quit }, ++ { "setlayout", setlayout }, ++ { "setlayoutex", setlayoutex }, ++}; ++ diff --git a/config.mk b/config.mk -index 6d36cb7..dbbc526 100644 +index 6d36cb7..5e93cfd 100644 --- a/config.mk +++ b/config.mk -@@ -6,6 +6,7 @@ VERSION = 6.2 - # paths - PREFIX = /usr/local - MANPREFIX = ${PREFIX}/share/man -+XSESSIONPREFIX = /usr/share/xsessions - - X11INC = /usr/X11R6/include - X11LIB = /usr/X11R6/lib -@@ -22,7 +23,7 @@ FREETYPEINC = /usr/include/freetype2 +@@ -22,7 +22,7 @@ FREETYPEINC = /usr/include/freetype2 # includes and libs INCS = -I${X11INC} -I${FREETYPEINC} @@ -238,225 +535,31 @@ index 6d36cb7..dbbc526 100644 # flags CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} -diff --git a/drw.c b/drw.c -index 8fd1ca4..4cdbcbe 100644 ---- a/drw.c -+++ b/drw.c -@@ -95,6 +95,7 @@ drw_free(Drw *drw) - { - XFreePixmap(drw->dpy, drw->drawable); - XFreeGC(drw->dpy, drw->gc); -+ drw_fontset_free(drw->fonts); - free(drw); - } - diff --git a/dwm.1 b/dwm.1 -index 13b3729..0ec6c60 100644 +index 13b3729..bf742fd 100644 --- a/dwm.1 +++ b/dwm.1 -@@ -12,10 +12,11 @@ environment for the application in use and the task performed. - In tiled layouts windows are managed in a master and stacking area. The master - area on the left contains one window by default, and the stacking area on the - right contains all other windows. The number of master area windows can be --adjusted from zero to an arbitrary number. In monocle layout all windows are --maximised to the screen size. In floating layout windows can be resized and --moved freely. Dialog windows are always managed floating, regardless of the --layout applied. -+adjusted from zero to an arbitrary number. Windows in both the master and stack -+can be resized vertically, as well as resizing the master area. In monocle -+layout all windows are maximised to the screen size. In floating layout windows -+can be resized and moved freely. Dialog windows are always managed floating, -+regardless of the layout applied. +@@ -29,6 +29,9 @@ color. The tags of the focused window are indicated with a filled square in the + top left corner. The tags which are applied to one or more windows are + indicated with an empty square in the top left corner. .P - Windows are grouped by tags. Each window can be tagged with one or multiple - tags. Selecting certain tags displays all windows with these tags. -@@ -24,16 +25,19 @@ Each screen contains a small status bar which displays all available tags, the - layout, the title of the focused window, and the text read from the root window - name property, if the screen is focused. A floating window is indicated with an - empty square and a maximised floating window is indicated with a filled square --before the windows title. The selected tags are indicated with a different --color. The tags of the focused window are indicated with a filled square in the --top left corner. The tags which are applied to one or more windows are --indicated with an empty square in the top left corner. -+before the window's title. The selected tags are indicated with a different -+color. The focused window is represented by a long line before the tags which -+are applied to it, and all other windows are represented by dots for all their -+corresponding tags. -+.P +The attach below patch makes newly spawned windows attach after the currently +selected window - .P ++.P dwm draws a small border around windows to indicate the focus state. .SH OPTIONS .TP - .B \-v --prints version information to standard output, then exits. -+prints version information to stderr, then exits. - .SH USAGE - .SS Status bar - .TP -@@ -56,41 +60,28 @@ click on a tag label applies that tag to the focused window. - click on a tag label adds/removes that tag to/from the focused window. - .SS Keyboard commands - .TP --.B Mod1\-Shift\-Return -+.B Mod1\-Return - Start -+.BR tabbed(1) -+Running - .BR st(1). - .TP - .B Mod1\-p -+Spawn passmenu. -+.TP -+.B Mod1\-d - Spawn - .BR dmenu(1) - for launching other programs. - .TP --.B Mod1\-, --Focus previous screen, if any. --.TP --.B Mod1\-. --Focus next screen, if any. --.TP --.B Mod1\-Shift\-, --Send focused window to previous screen, if any. --.TP --.B Mod1\-Shift\-. --Send focused window to next screen, if any. --.TP - .B Mod1\-b - Toggles bar on and off. - .TP --.B Mod1\-t --Sets tiled layout. -+.B Mod1\-Shift\-j -+Push the selected client window down the stack - .TP --.B Mod1\-f --Sets floating layout. --.TP --.B Mod1\-m --Sets monocle layout. --.TP --.B Mod1\-space --Toggles between current and previous layout. -+.B Mod1\-Shift\-k -+Push the selected client window up the stack - .TP - .B Mod1\-j - Focus next window. -@@ -98,50 +89,91 @@ Focus next window. - .B Mod1\-k - Focus previous window. - .TP --.B Mod1\-i --Increase number of windows in master area. -+.B Mod1\-, -+Increase the number of master windows. - .TP --.B Mod1\-d --Decrease number of windows in master area. -+.B Mod1\-. -+Decrease the number of master windows. -+.TP -+.B Mod1\-h -+Decrease master area size. - .TP - .B Mod1\-l - Increase master area size. - .TP --.B Mod1\-h --Decrease master area size. -+.B Mod1\-Shift\-h -+Increase the size ratio of the selected client - .TP --.B Mod1\-Return -+.B Mod1\-Shift\-l -+Decrease the size ratio of the selected client -+.B Mod1\-Shift\-o -+Reset the size ratio of the selected client -+.TP -+.B Mod1\-Shift\-Return - Zooms/cycles focused window to/from master area (tiled layouts only). - .TP --.B Mod1\-Shift\-c -+.B Mod1\-Tab -+Toggles to the previously selected tags. -+.TP -+.B Mod1\-Shift\-q - Close focused window. - .TP -+.B Mod1\-t -+Sets tiled layout. -+.TP -+.B Mod1\-s -+Sets floating layout. -+.TP -+.B Mod1\-m -+Sets monocle layout. -+.TP - .B Mod1\-Shift\-space --Toggle focused window between tiled and floating state. -+Toggles between current and previous layout. - .TP --.B Mod1\-Tab --Toggles to the previously selected tags. -+.B Mod1\-space -+Toggles the selected window into the floating state. - .TP --.B Mod1\-Shift\-[1..n] --Apply nth tag to focused window. -+.B Mod1\-f -+Toggle the selected window into the fullscreen state. -+.TP -+.B Mod1\-0 -+View all windows with any tag. - .TP - .B Mod1\-Shift\-0 - Apply all tags to focused window. - .TP -+.B Mod1\-Shift\-, -+Change focus to previous screen, if any. -+.TP -+.B Mod1\-Shift\-. -+Change focus to next screen, if any. -+.TP -+.B Mod1\-Control\-Shift\-, -+Send focused window to previous screen, if any. -+.TP -+.B Mod1\-Control\-Shift\-. -+Send focused window to next screen, if any. -+.TP -+.B Mod1\-Shift\-[1..n] -+Apply nth tag to focused window. -+.TP - .B Mod1\-Control\-Shift\-[1..n] - Add/remove nth tag to/from focused window. +@@ -142,6 +145,9 @@ Add/remove all windows with nth tag to/from the view. .TP - .B Mod1\-[1..n] - View all windows with nth tag. - .TP --.B Mod1\-0 --View all windows with any tag. --.TP - .B Mod1\-Control\-[1..n] - Add/remove all windows with nth tag to/from the view. - .TP --.B Mod1\-Shift\-q -+.B Mod1\-Shift\-e + .B Mod1\-Shift\-q Quit dwm. +.TP -+.B Mod1\-Shift\-r ++.B Mod1\-Control\-Shift\-q +Restart dwm. -+.TP -+.B Mod1\-Shift\-Tab -+Toggle AttachBelow patch .SS Mouse commands .TP .B Mod1\-Button1 -@@ -155,6 +187,41 @@ Resize focused window while dragging. Tiled windows will be toggled to the float +@@ -155,6 +161,13 @@ Resize focused window while dragging. Tiled windows will be toggled to the float .SH CUSTOMIZATION dwm is customized by creating a custom config.h and (re)compiling the source code. This keeps it fast, secure and simple. @@ -467,39 +570,11 @@ index 13b3729..0ec6c60 100644 +.TP +.B SIGTERM - 15 +Cleanly terminate the dwm process. -+.SH PATCHES -+This version of dwm was compiled using the: -+.TP -+.B dwm-actualfullscreen-20191112-cb3f58a.diff -+.TP -+.B dwm-attachbelow-toggleable-6.2.diff -+.TP -+.B dwm-autostart-20161205-bb3bd6f.diff -+.TP -+.B dwm-cfacts-20200913-61bb8b2.diff -+.TP -+.B dwm-clientindicators-6.2.diff -+.TP -+.B dwm-dwmc-6.2.diff -+.TP -+.B dwm-push_no_master-6.2.diff -+.TP -+.B dwm-restartsig-20180523-6.2.diff -+.TP -+.B dwm-statuscmd-signal-6.2.diff -+.TP -+.B dwm-swallow-20200522-7accbcf.diff -+.TP -+.B dwm-systray-6.2.diff -+.TP -+.B dwm-uselessgap-6.2.diff -+.TP -+.B dwm-zoomswap-6.2.diff .SH SEE ALSO .BR dmenu (1), .BR st (1) diff --git a/dwm.c b/dwm.c -index 4465af1..5fb86a6 100644 +index 4465af1..603497c 100644 --- a/dwm.c +++ b/dwm.c @@ -40,6 +40,8 @@ @@ -520,10 +595,10 @@ index 4465af1..5fb86a6 100644 -#define TAGMASK ((1 << LENGTH(tags)) - 1) +#define WIDTH(X) ((X)->w + 2 * (X)->bw + gappx) +#define HEIGHT(X) ((X)->h + 2 * (X)->bw + gappx) -+#define NUMTAGS (LENGTH(tags) + LENGTH(scratchpads)) -+#define TAGMASK ((1 << NUMTAGS) - 1) -+#define SPTAG(i) ((1 << LENGTH(tags) << (i))) -+#define SPTAGMASK (((1 << LENGTH(scratchpads))-1) << LENGTH(tags)) ++#define NUMTAGS (LENGTH(tags) + LENGTH(scratchpads)) ++#define TAGMASK ((1 << NUMTAGS) - 1) ++#define SPTAG(i) ((1 << LENGTH(tags)) << (i)) ++#define SPTAGMASK (((1 << LENGTH(scratchpads))-1) << LENGTH(tags)) #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) +#define SYSTEM_TRAY_REQUEST_DOCK 0 @@ -629,20 +704,18 @@ index 4465af1..5fb86a6 100644 static void focusin(XEvent *e); static void focusmon(const Arg *arg); static void focusstack(const Arg *arg); -+static int getdwmblockspid(); +static Atom getatomprop(Client *c, Atom prop); ++static int getdwmblockspid(); static int getrootptr(int *x, int *y); static long getstate(Window w); +static unsigned int getsystraywidth(); static int gettextprop(Window w, Atom atom, char *text, unsigned int size); static void grabbuttons(Client *c, int focused); static void grabkeys(void); -@@ -184,33 +231,47 @@ static void monocle(Monitor *m); - static void motionnotify(XEvent *e); +@@ -185,32 +232,46 @@ static void motionnotify(XEvent *e); static void movemouse(const Arg *arg); static Client *nexttiled(Client *c); --static void pop(Client *); -+//static void pop(Client *); + static void pop(Client *); +static Client *prevtiled(Client *c); static void propertynotify(XEvent *e); +static void pushdown(const Arg *arg); @@ -717,10 +790,10 @@ index 4465af1..5fb86a6 100644 +static Systray *systray = NULL; static const char broken[] = "broken"; static char stext[256]; ++static int scanner; +static char rawstext[256]; +static int dwmblockssig; +pid_t dwmblockspid = 0; -+static int scanner; static int screen; static int sw, sh; /* X display screen geometry width, height */ static int bh, blw = 0; /* bar geometry */ @@ -868,35 +941,36 @@ index 4465af1..5fb86a6 100644 void buttonpress(XEvent *e) { -@@ -439,9 +603,25 @@ buttonpress(XEvent *e) +@@ -439,9 +603,26 @@ buttonpress(XEvent *e) arg.ui = 1 << i; } else if (ev->x < x + blw) click = ClkLtSymbol; - else if (ev->x > selmon->ww - TEXTW(stext)) -+ else if (ev->x > (x = selmon->ww - (int)TEXTW(stext) + lrpad - getsystraywidth())) { ++ else if (ev->x > (x = selmon->ww - TEXTW(stext) + lrpad - getsystraywidth())) { click = ClkStatusText; - else -+ char *text = rawstext; -+ int i = -1; -+ char ch; -+ dwmblockssig = 0; -+ while (text[++i]) { -+ if ((unsigned char)text[i] < ' ') { -+ ch = text[i]; -+ text[i] = '\0'; -+ x += TEXTW(text) - lrpad; -+ text[i] = ch; -+ text += i+1; -+ i = -1; -+ if (x >= ev->x) break; -+ dwmblockssig = ch; -+ } -+ } -+ } else ++ ++ char *text = rawstext; ++ int i = -1; ++ char ch; ++ dwmblockssig = 0; ++ while (text[++i]) { ++ if ((unsigned char)text[i] < ' ') { ++ ch = text[i]; ++ text[i] = '\0'; ++ x += TEXTW(text) - lrpad; ++ text[i] = ch; ++ text += i+1; ++ i = -1; ++ if (x >= ev->x) break; ++ dwmblockssig = ch; ++ } ++ } ++ } else click = ClkWinTitle; } else if ((c = wintoclient(ev->window))) { focus(c); -@@ -482,6 +662,11 @@ cleanup(void) +@@ -482,6 +663,11 @@ cleanup(void) XUngrabKey(dpy, AnyKey, AnyModifier, root); while (mons) cleanupmon(mons); @@ -908,7 +982,7 @@ index 4465af1..5fb86a6 100644 for (i = 0; i < CurLast; i++) drw_cur_free(drw, cursor[i]); for (i = 0; i < LENGTH(colors); i++) -@@ -512,9 +697,57 @@ cleanupmon(Monitor *mon) +@@ -512,9 +698,57 @@ cleanupmon(Monitor *mon) void clientmessage(XEvent *e) { @@ -966,7 +1040,7 @@ index 4465af1..5fb86a6 100644 if (!c) return; if (cme->message_type == netatom[NetWMState]) { -@@ -567,7 +800,7 @@ configurenotify(XEvent *e) +@@ -567,7 +801,7 @@ configurenotify(XEvent *e) for (c = m->clients; c; c = c->next) if (c->isfullscreen) resizeclient(c, m->mx, m->my, m->mw, m->mh); @@ -975,7 +1049,7 @@ index 4465af1..5fb86a6 100644 } focus(NULL); arrange(NULL); -@@ -627,6 +860,19 @@ configurerequest(XEvent *e) +@@ -627,6 +861,19 @@ configurerequest(XEvent *e) XSync(dpy, False); } @@ -995,56 +1069,53 @@ index 4465af1..5fb86a6 100644 Monitor * createmon(void) { -@@ -652,6 +898,15 @@ destroynotify(XEvent *e) +@@ -652,6 +899,13 @@ destroynotify(XEvent *e) if ((c = wintoclient(ev->window))) unmanage(c, 1); -+ -+ else if ((c = wintosystrayicon(ev->window))) { -+ removesystrayicon(c); -+ resizebarwin(selmon); -+ updatesystray(); -+ } -+ -+ else if ((c = swallowingclient(ev->window))) -+ unmanage(c->swallowing, 1); ++ else if ((c = swallowingclient(ev->window))) ++ unmanage(c->swallowing, 1); ++ else if ((c = wintosystrayicon(ev->window))) { ++ removesystrayicon(c); ++ resizebarwin(selmon); ++ updatesystray(); ++ } } void -@@ -695,18 +950,24 @@ dirtomon(int dir) +@@ -695,19 +949,24 @@ dirtomon(int dir) void drawbar(Monitor *m) { - int x, w, sw = 0; + int indn; -+ int x, w, tw = 0, stw = 0; ++ int x, w, sw = 0, stw = 0; int boxs = drw->fonts->h / 9; int boxw = drw->fonts->h / 6 + 2; unsigned int i, occ = 0, urg = 0; Client *c; -+ if(showsystray && m == systraytomon(m)) -+ stw = getsystraywidth(); ++ if(showsystray && m == systraytomon(m)) ++ stw = getsystraywidth(); + /* draw status first so it can be overdrawn by tags later */ if (m == selmon) { /* status is only drawn on selected monitor */ drw_setscheme(drw, scheme[SchemeNorm]); - sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ - drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0); -- } -+ tw = TEXTW(stext) - lrpad / 2 + 2; /* 2px right padding */ -+ drw_text(drw, m->ww - tw - stw, 0, tw, bh, lrpad / 2 - 2, stext, 0); -+ } -+ -+ resizebarwin(m); ++ sw = TEXTW(stext) - lrpad / 2 + 2; /* 2px right padding */ ++ drw_text(drw, m->ww - sw - stw, 0, sw, bh, lrpad / 2 - 2, stext, 0); + } ++ resizebarwin(m); for (c = m->clients; c; c = c->next) { occ |= c->tags; -@@ -715,20 +976,24 @@ drawbar(Monitor *m) + if (c->isurgent) +@@ -715,20 +974,25 @@ drawbar(Monitor *m) } x = 0; for (i = 0; i < LENGTH(tags); i++) { -+ indn = 0; ++ indn = 0; w = TEXTW(tags[i]); drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); @@ -1052,12 +1123,13 @@ index 4465af1..5fb86a6 100644 - drw_rect(drw, x + boxs, boxs, boxw, boxw, - m == selmon && selmon->sel && selmon->sel->tags & 1 << i, - urg & 1 << i); -+ for (c = m->clients; c; c = c->next) { -+ if (c->tags & (1 << i)) { -+ drw_rect(drw, x, 1 + (indn * 2), selmon->sel == c ? 6 : 1, 1, 1, urg & 1 << i); -+ indn++; -+ } -+ } ++ ++ for (c = m->clients; c; c = c->next) { ++ if (c->tags & (1 << i)) { ++ drw_rect(drw, x, 1 + (indn * 2), selmon->sel == c ? 6 : 1, 1, 1, urg & 1 << i); ++ indn++; ++ } ++ } + x += w; } @@ -1066,11 +1138,11 @@ index 4465af1..5fb86a6 100644 x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); - if ((w = m->ww - sw - x) > bh) { -+ if ((w = m->ww - tw - stw - x) > bh) { ++ if ((w = m->ww - sw - stw - x) > bh) { if (m->sel) { drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); -@@ -739,7 +1004,7 @@ drawbar(Monitor *m) +@@ -739,7 +1003,7 @@ drawbar(Monitor *m) drw_rect(drw, x, 0, w, bh, 1, 1); } } @@ -1079,7 +1151,7 @@ index 4465af1..5fb86a6 100644 } void -@@ -776,8 +1041,21 @@ expose(XEvent *e) +@@ -776,8 +1040,21 @@ expose(XEvent *e) Monitor *m; XExposeEvent *ev = &e->xexpose; @@ -1102,7 +1174,7 @@ index 4465af1..5fb86a6 100644 } void -@@ -862,15 +1140,34 @@ getatomprop(Client *c, Atom prop) +@@ -862,15 +1139,34 @@ getatomprop(Client *c, Atom prop) unsigned long dl; unsigned char *p = NULL; Atom da, atom = None; @@ -1138,7 +1210,7 @@ index 4465af1..5fb86a6 100644 int getrootptr(int *x, int *y) { -@@ -899,6 +1196,16 @@ getstate(Window w) +@@ -899,6 +1195,16 @@ getstate(Window w) return result; } @@ -1155,7 +1227,7 @@ index 4465af1..5fb86a6 100644 int gettextprop(Window w, Atom atom, char *text, unsigned int size) { -@@ -998,12 +1305,55 @@ keypress(XEvent *e) +@@ -998,12 +1304,55 @@ keypress(XEvent *e) keys[i].func(&(keys[i].arg)); } @@ -1212,7 +1284,7 @@ index 4465af1..5fb86a6 100644 XGrabServer(dpy); XSetErrorHandler(xerrordummy); XSetCloseDownMode(dpy, DestroyAll); -@@ -1017,18 +1367,20 @@ killclient(const Arg *arg) +@@ -1017,18 +1366,20 @@ killclient(const Arg *arg) void manage(Window w, XWindowAttributes *wa) { @@ -1234,7 +1306,7 @@ index 4465af1..5fb86a6 100644 updatetitle(c); if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { -@@ -1037,6 +1389,7 @@ manage(Window w, XWindowAttributes *wa) +@@ -1037,6 +1388,7 @@ manage(Window w, XWindowAttributes *wa) } else { c->mon = selmon; applyrules(c); @@ -1242,7 +1314,7 @@ index 4465af1..5fb86a6 100644 } if (c->x + WIDTH(c) > c->mon->mx + c->mon->mw) -@@ -1062,7 +1415,10 @@ manage(Window w, XWindowAttributes *wa) +@@ -1062,7 +1414,10 @@ manage(Window w, XWindowAttributes *wa) c->isfloating = c->oldstate = trans != None || c->isfixed; if (c->isfloating) XRaiseWindow(dpy, c->win); @@ -1254,7 +1326,7 @@ index 4465af1..5fb86a6 100644 attachstack(c); XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, (unsigned char *) &(c->win), 1); -@@ -1073,6 +1429,8 @@ manage(Window w, XWindowAttributes *wa) +@@ -1073,6 +1428,8 @@ manage(Window w, XWindowAttributes *wa) c->mon->sel = c; arrange(c->mon); XMapWindow(dpy, c->win); @@ -1263,7 +1335,7 @@ index 4465af1..5fb86a6 100644 focus(NULL); } -@@ -1091,6 +1449,12 @@ maprequest(XEvent *e) +@@ -1091,6 +1448,12 @@ maprequest(XEvent *e) { static XWindowAttributes wa; XMapRequestEvent *ev = &e->xmaprequest; @@ -1276,20 +1348,10 @@ index 4465af1..5fb86a6 100644 if (!XGetWindowAttributes(dpy, ev->window, &wa)) return; -@@ -1199,6 +1563,7 @@ nexttiled(Client *c) - return c; - } - -+/* - void - pop(Client *c) - { -@@ -1207,6 +1572,17 @@ pop(Client *c) - focus(c); +@@ -1208,6 +1571,16 @@ pop(Client *c) arrange(c->mon); } -+*/ -+ + +Client * +prevtiled(Client *c) { + Client *p, *r; @@ -1299,10 +1361,11 @@ index 4465af1..5fb86a6 100644 + r = p; + return r; +} - ++ void propertynotify(XEvent *e) -@@ -1215,8 +1591,20 @@ propertynotify(XEvent *e) + { +@@ -1215,8 +1588,21 @@ propertynotify(XEvent *e) Window trans; XPropertyEvent *ev = &e->xproperty; @@ -1310,14 +1373,15 @@ index 4465af1..5fb86a6 100644 - updatestatus(); + if ((c = wintosystrayicon(ev->window))) { + if (ev->atom == XA_WM_NORMAL_HINTS) { -+ updatesizehints(c); -+ updatesystrayicongeom(c, c->w, c->h); -+ } else -+ updatesystrayiconstate(c, ev); ++ updatesizehints(c); ++ updatesystrayicongeom(c, c->w, c->h); ++ } ++ else ++ updatesystrayiconstate(c, ev); + resizebarwin(selmon); + updatesystray(); -+ + } ++ + if ((ev->window == root) && (ev->atom == XA_WM_NAME)) { + if (!fake_signal()) + updatestatus(); @@ -1325,7 +1389,7 @@ index 4465af1..5fb86a6 100644 else if (ev->state == PropertyDelete) return; /* ignore */ else if ((c = wintoclient(ev->window))) { -@@ -1245,9 +1633,41 @@ propertynotify(XEvent *e) +@@ -1245,9 +1631,41 @@ propertynotify(XEvent *e) } } @@ -1367,7 +1431,7 @@ index 4465af1..5fb86a6 100644 running = 0; } -@@ -1265,6 +1685,20 @@ recttomon(int x, int y, int w, int h) +@@ -1265,6 +1683,20 @@ recttomon(int x, int y, int w, int h) return r; } @@ -1388,7 +1452,7 @@ index 4465af1..5fb86a6 100644 void resize(Client *c, int x, int y, int w, int h, int interact) { -@@ -1272,16 +1706,48 @@ resize(Client *c, int x, int y, int w, int h, int interact) +@@ -1272,16 +1704,48 @@ resize(Client *c, int x, int y, int w, int h, int interact) resizeclient(c, x, y, w, h); } @@ -1441,7 +1505,7 @@ index 4465af1..5fb86a6 100644 XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); configure(c); XSync(dpy, False); -@@ -1344,6 +1810,19 @@ resizemouse(const Arg *arg) +@@ -1344,6 +1808,19 @@ resizemouse(const Arg *arg) } } @@ -1461,14 +1525,14 @@ index 4465af1..5fb86a6 100644 void restack(Monitor *m) { -@@ -1380,10 +1859,18 @@ run(void) +@@ -1380,10 +1857,18 @@ run(void) handler[ev.type](&ev); /* call handler */ } +void +runAutostart(void) { -+ system("cd ~; ./.config/dwm/autostart_blocking.sh"); -+ system("cd ~; ./.config/dwm/autostart.sh &"); ++ system("~/.config/dwm/autostart_blocking.sh"); ++ system("~/.config/dwm/autostart.sh &"); +} + void @@ -1480,7 +1544,7 @@ index 4465af1..5fb86a6 100644 Window d1, d2, *wins = NULL; XWindowAttributes wa; -@@ -1394,6 +1881,8 @@ scan(void) +@@ -1394,6 +1879,8 @@ scan(void) continue; if (wa.map_state == IsViewable || getstate(wins[i]) == IconicState) manage(wins[i], &wa); @@ -1489,7 +1553,7 @@ index 4465af1..5fb86a6 100644 } for (i = 0; i < num; i++) { /* now the transients */ if (!XGetWindowAttributes(dpy, wins[i], &wa)) -@@ -1405,6 +1894,7 @@ scan(void) +@@ -1405,6 +1892,7 @@ scan(void) if (wins) XFree(wins); } @@ -1497,7 +1561,7 @@ index 4465af1..5fb86a6 100644 } void -@@ -1417,7 +1907,10 @@ sendmon(Client *c, Monitor *m) +@@ -1417,7 +1905,10 @@ sendmon(Client *c, Monitor *m) detachstack(c); c->mon = m; c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ @@ -1509,7 +1573,7 @@ index 4465af1..5fb86a6 100644 attachstack(c); focus(NULL); arrange(NULL); -@@ -1433,26 +1926,36 @@ setclientstate(Client *c, long state) +@@ -1433,26 +1924,36 @@ setclientstate(Client *c, long state) } int @@ -1557,7 +1621,7 @@ index 4465af1..5fb86a6 100644 } return exists; } -@@ -1466,7 +1969,7 @@ setfocus(Client *c) +@@ -1466,7 +1967,7 @@ setfocus(Client *c) XA_WINDOW, 32, PropModeReplace, (unsigned char *) &(c->win), 1); } @@ -1566,7 +1630,7 @@ index 4465af1..5fb86a6 100644 } void -@@ -1511,6 +2014,23 @@ setlayout(const Arg *arg) +@@ -1511,6 +2012,23 @@ setlayout(const Arg *arg) drawbar(selmon); } @@ -1590,7 +1654,7 @@ index 4465af1..5fb86a6 100644 /* arg > 1.0 will set mfact absolutely */ void setmfact(const Arg *arg) -@@ -1536,6 +2056,9 @@ setup(void) +@@ -1536,6 +2054,9 @@ setup(void) /* clean up any zombies immediately */ sigchld(0); @@ -1600,7 +1664,7 @@ index 4465af1..5fb86a6 100644 /* init screen */ screen = DefaultScreen(dpy); sw = DisplayWidth(dpy, screen); -@@ -1555,6 +2078,10 @@ setup(void) +@@ -1555,6 +2076,10 @@ setup(void) wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False); netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); @@ -1611,7 +1675,7 @@ index 4465af1..5fb86a6 100644 netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); -@@ -1562,6 +2089,9 @@ setup(void) +@@ -1562,6 +2087,9 @@ setup(void) netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); @@ -1621,7 +1685,7 @@ index 4465af1..5fb86a6 100644 /* init cursors */ cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr); cursor[CurResize] = drw_cur_create(drw, XC_sizing); -@@ -1570,6 +2100,8 @@ setup(void) +@@ -1570,6 +2098,8 @@ setup(void) scheme = ecalloc(LENGTH(colors), sizeof(Clr *)); for (i = 0; i < LENGTH(colors); i++) scheme[i] = drw_scm_create(drw, colors[i], 3); @@ -1630,7 +1694,7 @@ index 4465af1..5fb86a6 100644 /* init bars */ updatebars(); updatestatus(); -@@ -1616,6 +2148,10 @@ showhide(Client *c) +@@ -1616,6 +2146,10 @@ showhide(Client *c) if (!c) return; if (ISVISIBLE(c)) { @@ -1641,7 +1705,7 @@ index 4465af1..5fb86a6 100644 /* show clients top down */ XMoveWindow(dpy, c->win, c->x, c->y); if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen) -@@ -1636,6 +2172,37 @@ sigchld(int unused) +@@ -1636,6 +2170,37 @@ sigchld(int unused) while (0 < waitpid(-1, NULL, WNOHANG)); } @@ -1679,7 +1743,7 @@ index 4465af1..5fb86a6 100644 void spawn(const Arg *arg) { -@@ -1674,9 +2241,15 @@ void +@@ -1674,9 +2239,15 @@ void tile(Monitor *m) { unsigned int i, n, h, mw, my, ty; @@ -1696,31 +1760,25 @@ index 4465af1..5fb86a6 100644 if (n == 0) return; -@@ -1686,13 +2259,19 @@ tile(Monitor *m) +@@ -1686,13 +2257,15 @@ tile(Monitor *m) mw = m->ww; for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) if (i < m->nmaster) { - h = (m->wh - my) / (MIN(n, m->nmaster) - i); + h = (m->wh - my) * (c->cfact / mfacts); resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0); -- my += HEIGHT(c); -+ if (my + HEIGHT(c) < m->wh) { -+ my += HEIGHT(c); -+ mfacts -= c->cfact; -+ } + my += HEIGHT(c); ++ mfacts -= c->cfact; } else { - h = (m->wh - ty) / (n - i); + h = (m->wh - ty) * (c->cfact / sfacts); resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0); -- ty += HEIGHT(c); -+ if (ty + HEIGHT(c) < m->wh) { -+ ty += HEIGHT(c); -+ sfacts -= c->cfact; -+ } + ty += HEIGHT(c); ++ sfacts -= c->cfact; } } -@@ -1701,7 +2280,18 @@ togglebar(const Arg *arg) +@@ -1701,7 +2274,18 @@ togglebar(const Arg *arg) { selmon->showbar = !selmon->showbar; updatebarpos(selmon); @@ -1740,18 +1798,11 @@ index 4465af1..5fb86a6 100644 arrange(selmon); } -@@ -1719,6 +2309,39 @@ togglefloating(const Arg *arg) +@@ -1719,6 +2303,39 @@ togglefloating(const Arg *arg) arrange(selmon); } +void -+togglefullscr(const Arg *arg) -+{ -+ if(selmon->sel) -+ setfullscreen(selmon->sel, !selmon->sel->isfullscreen); -+} -+ -+void +togglescratch(const Arg *arg) +{ + Client *c; @@ -1777,10 +1828,17 @@ index 4465af1..5fb86a6 100644 + } +} + ++void ++togglefullscr(const Arg *arg) ++{ ++ if(selmon->sel) ++ setfullscreen(selmon->sel, !selmon->sel->isfullscreen); ++} ++ void toggletag(const Arg *arg) { -@@ -1765,6 +2388,20 @@ unmanage(Client *c, int destroyed) +@@ -1765,6 +2382,20 @@ unmanage(Client *c, int destroyed) Monitor *m = c->mon; XWindowChanges wc; @@ -1801,7 +1859,7 @@ index 4465af1..5fb86a6 100644 detach(c); detachstack(c); if (!destroyed) { -@@ -1779,9 +2416,12 @@ unmanage(Client *c, int destroyed) +@@ -1779,9 +2410,12 @@ unmanage(Client *c, int destroyed) XUngrabServer(dpy); } free(c); @@ -1817,7 +1875,7 @@ index 4465af1..5fb86a6 100644 } void -@@ -1796,11 +2436,18 @@ unmapnotify(XEvent *e) +@@ -1796,11 +2430,18 @@ unmapnotify(XEvent *e) else unmanage(c, 0); } @@ -1836,7 +1894,7 @@ index 4465af1..5fb86a6 100644 Monitor *m; XSetWindowAttributes wa = { .override_redirect = True, -@@ -1811,10 +2458,15 @@ updatebars(void) +@@ -1811,10 +2452,15 @@ updatebars(void) for (m = mons; m; m = m->next) { if (m->barwin) continue; @@ -1853,7 +1911,7 @@ index 4465af1..5fb86a6 100644 XMapRaised(dpy, m->barwin); XSetClassHint(dpy, m->barwin, &ch); } -@@ -1897,7 +2549,10 @@ updategeom(void) +@@ -1897,7 +2543,10 @@ updategeom(void) m->clients = c->next; detachstack(c); c->mon = mons; @@ -1865,7 +1923,7 @@ index 4465af1..5fb86a6 100644 attachstack(c); } if (m == selmon) -@@ -1987,9 +2642,126 @@ updatesizehints(Client *c) +@@ -1987,9 +2636,126 @@ updatesizehints(Client *c) void updatestatus(void) { @@ -1993,7 +2051,7 @@ index 4465af1..5fb86a6 100644 } void -@@ -2044,6 +2816,110 @@ view(const Arg *arg) +@@ -2044,6 +2810,110 @@ view(const Arg *arg) arrange(selmon); } @@ -2104,7 +2162,7 @@ index 4465af1..5fb86a6 100644 Client * wintoclient(Window w) { -@@ -2057,6 +2933,16 @@ wintoclient(Window w) +@@ -2057,6 +2927,16 @@ wintoclient(Window w) return NULL; } @@ -2121,7 +2179,7 @@ index 4465af1..5fb86a6 100644 Monitor * wintomon(Window w) { -@@ -2110,18 +2996,58 @@ xerrorstart(Display *dpy, XErrorEvent *ee) +@@ -2110,18 +2990,58 @@ xerrorstart(Display *dpy, XErrorEvent *ee) return -1; } @@ -2184,7 +2242,7 @@ index 4465af1..5fb86a6 100644 } int -@@ -2135,6 +3061,8 @@ main(int argc, char *argv[]) +@@ -2135,6 +3055,8 @@ main(int argc, char *argv[]) fputs("warning: no locale support\n", stderr); if (!(dpy = XOpenDisplay(NULL))) die("dwm: cannot open display"); @@ -2193,14 +2251,155 @@ index 4465af1..5fb86a6 100644 checkotherwm(); setup(); #ifdef __OpenBSD__ -@@ -2142,7 +3070,9 @@ main(int argc, char *argv[]) +@@ -2142,7 +3064,9 @@ main(int argc, char *argv[]) die("pledge"); #endif /* __OpenBSD__ */ scan(); -- run(); + runAutostart(); -+run(); + run(); + if(restart) execvp(argv[0], argv); cleanup(); XCloseDisplay(dpy); return EXIT_SUCCESS; +diff --git a/dwm.desktop b/dwm.desktop +new file mode 100644 +index 0000000..5a6021f +--- /dev/null ++++ b/dwm.desktop +@@ -0,0 +1,10 @@ ++[Desktop Entry] ++Version=6.3 ++Type=Application ++Name=dwm ++Comment=Suckless' dynamic window manager ++Exec=dwm ++Icon=dwm ++Terminal=false ++StartupNotify=false ++Categories=Application; +diff --git a/dwmc b/dwmc +new file mode 100755 +index 0000000..5ff8dbc +--- /dev/null ++++ b/dwmc +@@ -0,0 +1,40 @@ ++#!/usr/bin/env sh ++ ++signal() { ++ xsetroot -name "fsignal:$*" ++} ++ ++case $# in ++1) ++ case $1 in ++ setlayout | view | viewall | togglebar | togglefloating | zoom | killclient | quit) ++ signal $1 ++ ;; ++ *) ++ echo "Unknown command or missing one argument." ++ exit 1 ++ ;; ++ esac ++ ;; ++2) ++ case $1 in ++ view) ++ signal $1 ui $2 ++ ;; ++ viewex | toggleviewex | tagex | toggletagex | setlayoutex | focusstack | incnmaster | focusmon | tagmon) ++ signal $1 i $2 ++ ;; ++ setmfact) ++ signal $1 f $2 ++ ;; ++ *) ++ echo "Unknown command or one too many arguments." ++ exit 1 ++ ;; ++ esac ++ ;; ++*) ++ echo "Too many arguments." ++ exit 1 ++ ;; ++esac +diff --git a/tcl.c b/tcl.c +new file mode 100644 +index 0000000..4c94914 +--- /dev/null ++++ b/tcl.c +@@ -0,0 +1,74 @@ ++void ++tcl(Monitor * m) ++{ ++ int x, y, h, w, mw, sw, bdw; ++ unsigned int i, n; ++ Client * c; ++ ++ for (n = 0, c = nexttiled(m->clients); c; ++ c = nexttiled(c->next), n++); ++ ++ if (n == 0) ++ return; ++ ++ c = nexttiled(m->clients); ++ ++ mw = m->mfact * m->ww; ++ sw = (m->ww - mw) / 2; ++ bdw = (2 * c->bw); ++ resize(c, ++ n < 3 ? m->wx : m->wx + sw, ++ m->wy, ++ n == 1 ? m->ww - bdw : mw - bdw, ++ m->wh - bdw, ++ False); ++ ++ if (--n == 0) ++ return; ++ ++ w = (m->ww - mw) / ((n > 1) + 1); ++ c = nexttiled(c->next); ++ ++ if (n > 1) ++ { ++ x = m->wx + ((n > 1) ? mw + sw : mw); ++ y = m->wy; ++ h = m->wh / (n / 2); ++ ++ if (h < bh) ++ h = m->wh; ++ ++ for (i = 0; c && i < n / 2; c = nexttiled(c->next), i++) ++ { ++ resize(c, ++ x, ++ y, ++ w - bdw, ++ (i + 1 == n / 2) ? m->wy + m->wh - y - bdw : h - bdw, ++ False); ++ ++ if (h != m->wh) ++ y = c->y + HEIGHT(c); ++ } ++ } ++ ++ x = (n + 1 / 2) == 1 ? mw : m->wx; ++ y = m->wy; ++ h = m->wh / ((n + 1) / 2); ++ ++ if (h < bh) ++ h = m->wh; ++ ++ for (i = 0; c; c = nexttiled(c->next), i++) ++ { ++ resize(c, ++ x, ++ y, ++ (i + 1 == (n + 1) / 2) ? w - bdw : w - bdw, ++ (i + 1 == (n + 1) / 2) ? m->wy + m->wh - y - bdw : h - bdw, ++ False); ++ ++ if (h != m->wh) ++ y = c->y + HEIGHT(c); ++ } ++} @@ -12,11 +12,10 @@ environment for the application in use and the task performed. In tiled layouts windows are managed in a master and stacking area. The master area on the left contains one window by default, and the stacking area on the right contains all other windows. The number of master area windows can be -adjusted from zero to an arbitrary number. Windows in both the master and stack -can be resized vertically, as well as resizing the master area. In monocle -layout all windows are maximised to the screen size. In floating layout windows -can be resized and moved freely. Dialog windows are always managed floating, -regardless of the layout applied. +adjusted from zero to an arbitrary number. In monocle layout all windows are +maximised to the screen size. In floating layout windows can be resized and +moved freely. Dialog windows are always managed floating, regardless of the +layout applied. .P Windows are grouped by tags. Each window can be tagged with one or multiple tags. Selecting certain tags displays all windows with these tags. @@ -25,10 +24,10 @@ Each screen contains a small status bar which displays all available tags, the layout, the title of the focused window, and the text read from the root window name property, if the screen is focused. A floating window is indicated with an empty square and a maximised floating window is indicated with a filled square -before the window's title. The selected tags are indicated with a different -color. The focused window is represented by a long line before the tags which -are applied to it, and all other windows are represented by dots for all their -corresponding tags. +before the windows title. The selected tags are indicated with a different +color. The tags of the focused window are indicated with a filled square in the +top left corner. The tags which are applied to one or more windows are +indicated with an empty square in the top left corner. .P The attach below patch makes newly spawned windows attach after the currently selected window @@ -37,7 +36,7 @@ dwm draws a small border around windows to indicate the focus state. .SH OPTIONS .TP .B \-v -prints version information to stderr, then exits. +prints version information to standard output, then exits. .SH USAGE .SS Status bar .TP @@ -60,120 +59,95 @@ click on a tag label applies that tag to the focused window. click on a tag label adds/removes that tag to/from the focused window. .SS Keyboard commands .TP -.B Mod1\-Return +.B Mod1\-Shift\-Return Start -.BR tabbed(1) -Running .BR st(1). .TP .B Mod1\-p -Spawn passmenu. -.TP -.B Mod1\-d Spawn .BR dmenu(1) for launching other programs. .TP -.B Mod1\-b -Toggles bar on and off. -.TP -.B Mod1\-Shift\-j -Push the selected client window down the stack -.TP -.B Mod1\-Shift\-k -Push the selected client window up the stack -.TP -.B Mod1\-j -Focus next window. -.TP -.B Mod1\-k -Focus previous window. -.TP .B Mod1\-, -Increase the number of master windows. +Focus previous screen, if any. .TP .B Mod1\-. -Decrease the number of master windows. -.TP -.B Mod1\-h -Decrease master area size. -.TP -.B Mod1\-l -Increase master area size. -.TP -.B Mod1\-Shift\-h -Increase the size ratio of the selected client +Focus next screen, if any. .TP -.B Mod1\-Shift\-l -Decrease the size ratio of the selected client -.B Mod1\-Shift\-o -Reset the size ratio of the selected client -.TP -.B Mod1\-Shift\-Return -Zooms/cycles focused window to/from master area (tiled layouts only). +.B Mod1\-Shift\-, +Send focused window to previous screen, if any. .TP -.B Mod1\-Tab -Toggles to the previously selected tags. +.B Mod1\-Shift\-. +Send focused window to next screen, if any. .TP -.B Mod1\-Shift\-q -Close focused window. +.B Mod1\-b +Toggles bar on and off. .TP .B Mod1\-t Sets tiled layout. .TP -.B Mod1\-s +.B Mod1\-f Sets floating layout. .TP .B Mod1\-m Sets monocle layout. .TP -.B Mod1\-Shift\-space +.B Mod1\-space Toggles between current and previous layout. .TP -.B Mod1\-space -Toggles the selected window into the floating state. +.B Mod1\-j +Focus next window. .TP -.B Mod1\-f -Toggle the selected window into the fullscreen state. +.B Mod1\-k +Focus previous window. .TP -.B Mod1\-0 -View all windows with any tag. +.B Mod1\-i +Increase number of windows in master area. .TP -.B Mod1\-Shift\-0 -Apply all tags to focused window. +.B Mod1\-d +Decrease number of windows in master area. .TP -.B Mod1\-Shift\-, -Change focus to previous screen, if any. +.B Mod1\-l +Increase master area size. .TP -.B Mod1\-Shift\-. -Change focus to next screen, if any. +.B Mod1\-h +Decrease master area size. .TP -.B Mod1\-Control\-Shift\-, -Send focused window to previous screen, if any. +.B Mod1\-Return +Zooms/cycles focused window to/from master area (tiled layouts only). .TP -.B Mod1\-Control\-Shift\-. -Send focused window to next screen, if any. +.B Mod1\-Shift\-c +Close focused window. +.TP +.B Mod1\-Shift\-space +Toggle focused window between tiled and floating state. +.TP +.B Mod1\-Tab +Toggles to the previously selected tags. .TP .B Mod1\-Shift\-[1..n] Apply nth tag to focused window. .TP +.B Mod1\-Shift\-0 +Apply all tags to focused window. +.TP .B Mod1\-Control\-Shift\-[1..n] Add/remove nth tag to/from focused window. .TP .B Mod1\-[1..n] View all windows with nth tag. .TP +.B Mod1\-0 +View all windows with any tag. +.TP .B Mod1\-Control\-[1..n] Add/remove all windows with nth tag to/from the view. .TP -.B Mod1\-Shift\-e +.B Mod1\-Shift\-q Quit dwm. .TP -.B Mod1\-Shift\-r +.B Mod1\-Control\-Shift\-q Restart dwm. -.TP -.B Mod1\-Shift\-Tab -Toggle AttachBelow patch .SS Mouse commands .TP .B Mod1\-Button1 @@ -194,34 +168,6 @@ Restart the dwm process. .TP .B SIGTERM - 15 Cleanly terminate the dwm process. -.SH PATCHES -This version of dwm was compiled using the: -.TP -.B dwm-actualfullscreen-20191112-cb3f58a.diff -.TP -.B dwm-attachbelow-toggleable-6.2.diff -.TP -.B dwm-autostart-20161205-bb3bd6f.diff -.TP -.B dwm-cfacts-20200913-61bb8b2.diff -.TP -.B dwm-clientindicators-6.2.diff -.TP -.B dwm-dwmc-6.2.diff -.TP -.B dwm-push_no_master-6.2.diff -.TP -.B dwm-restartsig-20180523-6.2.diff -.TP -.B dwm-statuscmd-signal-6.2.diff -.TP -.B dwm-swallow-20200522-7accbcf.diff -.TP -.B dwm-systray-6.2.diff -.TP -.B dwm-uselessgap-6.2.diff -.TP -.B dwm-zoomswap-6.2.diff .SH SEE ALSO .BR dmenu (1), .BR st (1) @@ -56,10 +56,10 @@ #define MOUSEMASK (BUTTONMASK|PointerMotionMask) #define WIDTH(X) ((X)->w + 2 * (X)->bw + gappx) #define HEIGHT(X) ((X)->h + 2 * (X)->bw + gappx) -#define NUMTAGS (LENGTH(tags) + LENGTH(scratchpads)) -#define TAGMASK ((1 << NUMTAGS) - 1) -#define SPTAG(i) ((1 << LENGTH(tags) << (i))) -#define SPTAGMASK (((1 << LENGTH(scratchpads))-1) << LENGTH(tags)) +#define NUMTAGS (LENGTH(tags) + LENGTH(scratchpads)) +#define TAGMASK ((1 << NUMTAGS) - 1) +#define SPTAG(i) ((1 << LENGTH(tags)) << (i)) +#define SPTAGMASK (((1 << LENGTH(scratchpads))-1) << LENGTH(tags)) #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) #define SYSTEM_TRAY_REQUEST_DOCK 0 @@ -213,8 +213,8 @@ static void focus(Client *c); static void focusin(XEvent *e); static void focusmon(const Arg *arg); static void focusstack(const Arg *arg); -static int getdwmblockspid(); static Atom getatomprop(Client *c, Atom prop); +static int getdwmblockspid(); static int getrootptr(int *x, int *y); static long getstate(Window w); static unsigned int getsystraywidth(); @@ -231,7 +231,7 @@ static void monocle(Monitor *m); static void motionnotify(XEvent *e); static void movemouse(const Arg *arg); static Client *nexttiled(Client *c); -//static void pop(Client *); +static void pop(Client *); static Client *prevtiled(Client *c); static void propertynotify(XEvent *e); static void pushdown(const Arg *arg); @@ -310,10 +310,10 @@ static Client *prevzoom = NULL; static Systray *systray = NULL; static const char broken[] = "broken"; static char stext[256]; +static int scanner; static char rawstext[256]; static int dwmblockssig; pid_t dwmblockspid = 0; -static int scanner; static int screen; static int sw, sh; /* X display screen geometry width, height */ static int bh, blw = 0; /* bar geometry */ @@ -432,7 +432,7 @@ applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact) *h = bh; if (*w < bh) *w = bh; - if ((resizehints && !c->isterminal) || c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) { + if (resizehints || c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) { /* see last two sentences in ICCCM 4.1.2.3 */ baseismin = c->basew == c->minw && c->baseh == c->minh; if (!baseismin) { /* temporarily remove base dimensions */ @@ -603,25 +603,26 @@ buttonpress(XEvent *e) arg.ui = 1 << i; } else if (ev->x < x + blw) click = ClkLtSymbol; - else if (ev->x > (x = selmon->ww - (int)TEXTW(stext) + lrpad - getsystraywidth())) { + else if (ev->x > (x = selmon->ww - TEXTW(stext) + lrpad - getsystraywidth())) { click = ClkStatusText; - char *text = rawstext; - int i = -1; - char ch; - dwmblockssig = 0; - while (text[++i]) { - if ((unsigned char)text[i] < ' ') { - ch = text[i]; - text[i] = '\0'; - x += TEXTW(text) - lrpad; - text[i] = ch; - text += i+1; - i = -1; - if (x >= ev->x) break; - dwmblockssig = ch; - } - } - } else + + char *text = rawstext; + int i = -1; + char ch; + dwmblockssig = 0; + while (text[++i]) { + if ((unsigned char)text[i] < ' ') { + ch = text[i]; + text[i] = '\0'; + x += TEXTW(text) - lrpad; + text[i] = ch; + text += i+1; + i = -1; + if (x >= ev->x) break; + dwmblockssig = ch; + } + } + } else click = ClkWinTitle; } else if ((c = wintoclient(ev->window))) { focus(c); @@ -898,15 +899,13 @@ destroynotify(XEvent *e) if ((c = wintoclient(ev->window))) unmanage(c, 1); - - else if ((c = wintosystrayicon(ev->window))) { - removesystrayicon(c); - resizebarwin(selmon); - updatesystray(); - } - - else if ((c = swallowingclient(ev->window))) - unmanage(c->swallowing, 1); + else if ((c = swallowingclient(ev->window))) + unmanage(c->swallowing, 1); + else if ((c = wintosystrayicon(ev->window))) { + removesystrayicon(c); + resizebarwin(selmon); + updatesystray(); + } } void @@ -951,24 +950,23 @@ void drawbar(Monitor *m) { int indn; - int x, w, tw = 0, stw = 0; + int x, w, sw = 0, stw = 0; int boxs = drw->fonts->h / 9; int boxw = drw->fonts->h / 6 + 2; unsigned int i, occ = 0, urg = 0; Client *c; - if(showsystray && m == systraytomon(m)) - stw = getsystraywidth(); + if(showsystray && m == systraytomon(m)) + stw = getsystraywidth(); /* draw status first so it can be overdrawn by tags later */ if (m == selmon) { /* status is only drawn on selected monitor */ drw_setscheme(drw, scheme[SchemeNorm]); - tw = TEXTW(stext) - lrpad / 2 + 2; /* 2px right padding */ - drw_text(drw, m->ww - tw - stw, 0, tw, bh, lrpad / 2 - 2, stext, 0); - } - - resizebarwin(m); + sw = TEXTW(stext) - lrpad / 2 + 2; /* 2px right padding */ + drw_text(drw, m->ww - sw - stw, 0, sw, bh, lrpad / 2 - 2, stext, 0); + } + resizebarwin(m); for (c = m->clients; c; c = c->next) { occ |= c->tags; if (c->isurgent) @@ -976,16 +974,17 @@ drawbar(Monitor *m) } x = 0; for (i = 0; i < LENGTH(tags); i++) { - indn = 0; + indn = 0; w = TEXTW(tags[i]); drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); - for (c = m->clients; c; c = c->next) { - if (c->tags & (1 << i)) { - drw_rect(drw, x, 1 + (indn * 2), selmon->sel == c ? 6 : 1, 1, 1, urg & 1 << i); - indn++; - } - } + + for (c = m->clients; c; c = c->next) { + if (c->tags & (1 << i)) { + drw_rect(drw, x, 1 + (indn * 2), selmon->sel == c ? 6 : 1, 1, 1, urg & 1 << i); + indn++; + } + } x += w; } @@ -993,7 +992,7 @@ drawbar(Monitor *m) drw_setscheme(drw, scheme[SchemeNorm]); x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); - if ((w = m->ww - tw - stw - x) > bh) { + if ((w = m->ww - sw - stw - x) > bh) { if (m->sel) { drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); @@ -1563,7 +1562,6 @@ nexttiled(Client *c) return c; } -/* void pop(Client *c) { @@ -1572,7 +1570,6 @@ pop(Client *c) focus(c); arrange(c->mon); } -*/ Client * prevtiled(Client *c) { @@ -1593,14 +1590,15 @@ propertynotify(XEvent *e) if ((c = wintosystrayicon(ev->window))) { if (ev->atom == XA_WM_NORMAL_HINTS) { - updatesizehints(c); - updatesystrayicongeom(c, c->w, c->h); - } else - updatesystrayiconstate(c, ev); + updatesizehints(c); + updatesystrayicongeom(c, c->w, c->h); + } + else + updatesystrayiconstate(c, ev); resizebarwin(selmon); updatesystray(); - } + if ((ev->window == root) && (ev->atom == XA_WM_NAME)) { if (!fake_signal()) updatestatus(); @@ -1861,8 +1859,8 @@ run(void) void runAutostart(void) { - system("cd ~; ./.config/dwm/autostart_blocking.sh"); - system("cd ~; ./.config/dwm/autostart.sh &"); + system("~/.config/dwm/autostart_blocking.sh"); + system("~/.config/dwm/autostart.sh &"); } void @@ -2261,17 +2259,13 @@ tile(Monitor *m) if (i < m->nmaster) { h = (m->wh - my) * (c->cfact / mfacts); resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0); - if (my + HEIGHT(c) < m->wh) { - my += HEIGHT(c); - mfacts -= c->cfact; - } + my += HEIGHT(c); + mfacts -= c->cfact; } else { h = (m->wh - ty) * (c->cfact / sfacts); resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0); - if (ty + HEIGHT(c) < m->wh) { - ty += HEIGHT(c); - sfacts -= c->cfact; - } + ty += HEIGHT(c); + sfacts -= c->cfact; } } @@ -2310,13 +2304,6 @@ togglefloating(const Arg *arg) } void -togglefullscr(const Arg *arg) -{ - if(selmon->sel) - setfullscreen(selmon->sel, !selmon->sel->isfullscreen); -} - -void togglescratch(const Arg *arg) { Client *c; @@ -2343,6 +2330,13 @@ togglescratch(const Arg *arg) } void +togglefullscr(const Arg *arg) +{ + if(selmon->sel) + setfullscreen(selmon->sel, !selmon->sel->isfullscreen); +} + +void toggletag(const Arg *arg) { unsigned int newtags; @@ -3071,7 +3065,7 @@ main(int argc, char *argv[]) #endif /* __OpenBSD__ */ scan(); runAutostart(); -run(); + run(); if(restart) execvp(argv[0], argv); cleanup(); XCloseDisplay(dpy); |