dotfiles

personal dotfiles
git clone anongit@rnpnr.xyz:dotfiles.git
Log | Files | Refs | Feed | Submodules

Commit: b5eae1cd733f635a56e9cd77575c939490dadc79
Parent: 748bafe298e3e0f870ff12151702070754b81be3
Author: 0x766F6964
Date:   Sat, 13 Feb 2021 16:26:04 -0700

remove dwm config from portage and add submodule for my personal fork

Diffstat:
M.gitmodules | 3+++
M.sys/etc/portage/package.use/x11 | 1+
D.sys/etc/portage/patches/x11-wm/dwm/barheight.patch | 13-------------
D.sys/etc/portage/patches/x11-wm/dwm/dwm-bottomstack-6.1.patch | 101-------------------------------------------------------------------------------
D.sys/etc/portage/patches/x11-wm/dwm/fakefullscreen.patch | 90-------------------------------------------------------------------------------
D.sys/etc/portage/patches/x11-wm/dwm/hide_vacant_tags-git-2018-03-24.patch | 52----------------------------------------------------
D.sys/etc/portage/savedconfig/x11-wm/dwm-9999 | 160-------------------------------------------------------------------------------
Asrc/c/dwm | 1+
8 files changed, 5 insertions(+), 416 deletions(-)

diff --git a/.gitmodules b/.gitmodules @@ -19,3 +19,6 @@ [submodule ".config/mpv/scripts/mpvacious"] path = .config/mpv/scripts/mpvacious url = https://github.com/Ajatt-Tools/mpvacious.git +[submodule "src/c/dwm"] + path = src/c/dwm + url = git@github.com:0x766F6964/dwm.git diff --git a/.sys/etc/portage/package.use/x11 b/.sys/etc/portage/package.use/x11 @@ -1,3 +1,4 @@ x11-base/xorg-server -elogind -minimal suid x11-libs/cairo svg x11-libs/libxcb xkb +x11-wm/dwm -savedconfig diff --git a/.sys/etc/portage/patches/x11-wm/dwm/barheight.patch b/.sys/etc/portage/patches/x11-wm/dwm/barheight.patch @@ -1,13 +0,0 @@ -diff --git a/dwm.c b/dwm.c -index ec6a27c..fa4f8e9 100644 ---- a/dwm.c -+++ b/dwm.c -@@ -1546,7 +1546,7 @@ setup(void) - if (!drw_fontset_create(drw, fonts, LENGTH(fonts))) - die("no fonts could be loaded."); - lrpad = drw->fonts->h; -- bh = drw->fonts->h + 2; -+ bh = drw->fonts->h + 8; - updategeom(); - /* init atoms */ - utf8string = XInternAtom(dpy, "UTF8_STRING", False); diff --git a/.sys/etc/portage/patches/x11-wm/dwm/dwm-bottomstack-6.1.patch b/.sys/etc/portage/patches/x11-wm/dwm/dwm-bottomstack-6.1.patch @@ -1,101 +0,0 @@ -diff --git a/config.def.h b/config.def.h -index 7054c06..554f1db 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 }, -+ { "TTT", bstack }, -+ { "===", bstackhoriz }, - }; - - /* 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..c313b5e 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 bstack(Monitor *m); -+static void bstackhoriz(Monitor *m); - - /* variables */ - static const char broken[] = "broken"; -@@ -2139,3 +2141,65 @@ main(int argc, char *argv[]) - XCloseDisplay(dpy); - return EXIT_SUCCESS; - } -+ -+static void -+bstack(Monitor *m) { -+ int w, h, mh, mx, tx, ty, tw; -+ unsigned int i, n; -+ Client *c; -+ -+ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); -+ if (n == 0) -+ return; -+ if (n > m->nmaster) { -+ mh = m->nmaster ? m->mfact * m->wh : 0; -+ tw = m->ww / (n - m->nmaster); -+ ty = m->wy + mh; -+ } else { -+ mh = m->wh; -+ tw = m->ww; -+ ty = m->wy; -+ } -+ for (i = mx = 0, tx = m->wx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { -+ if (i < m->nmaster) { -+ w = (m->ww - mx) / (MIN(n, m->nmaster) - i); -+ resize(c, m->wx + mx, m->wy, w - (2 * c->bw), mh - (2 * c->bw), 0); -+ mx += WIDTH(c); -+ } else { -+ h = m->wh - mh; -+ resize(c, tx, ty, tw - (2 * c->bw), h - (2 * c->bw), 0); -+ if (tw != m->ww) -+ tx += WIDTH(c); -+ } -+ } -+} -+ -+static void -+bstackhoriz(Monitor *m) { -+ int w, mh, mx, tx, ty, th; -+ unsigned int i, n; -+ Client *c; -+ -+ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); -+ if (n == 0) -+ return; -+ if (n > m->nmaster) { -+ mh = m->nmaster ? m->mfact * m->wh : 0; -+ th = (m->wh - mh) / (n - m->nmaster); -+ ty = m->wy + mh; -+ } else { -+ th = mh = m->wh; -+ ty = m->wy; -+ } -+ for (i = mx = 0, tx = m->wx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { -+ if (i < m->nmaster) { -+ w = (m->ww - mx) / (MIN(n, m->nmaster) - i); -+ resize(c, m->wx + mx, m->wy, w - (2 * c->bw), mh - (2 * c->bw), 0); -+ mx += WIDTH(c); -+ } else { -+ resize(c, tx, ty, m->ww - (2 * c->bw), th - (2 * c->bw), 0); -+ if (th != m->wh) -+ ty += HEIGHT(c); -+ } -+ } -+} diff --git a/.sys/etc/portage/patches/x11-wm/dwm/fakefullscreen.patch b/.sys/etc/portage/patches/x11-wm/dwm/fakefullscreen.patch @@ -1,90 +0,0 @@ -diff --git a/config.def.h b/config.def.h -index 1c0b587..1db5e32 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -17,6 +17,7 @@ static const char *colors[][3] = { - [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, - [SchemeSel] = { col_gray4, col_cyan, col_cyan }, - }; -+static int realfullscreen = 0; - - /* tagging */ - static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; -@@ -94,6 +95,7 @@ static Key keys[] = { - TAGKEYS( XK_8, 7) - TAGKEYS( XK_9, 8) - { MODKEY|ShiftMask, XK_q, quit, {0} }, -+ { MODKEY|ShiftMask, XK_y, togglerealfull, {0} }, - }; - - /* button definitions */ -diff --git a/dwm.c b/dwm.c -index 4465af1..30a2b7b 100644 ---- a/dwm.c -+++ b/dwm.c -@@ -187,6 +187,7 @@ static Client *nexttiled(Client *c); - static void pop(Client *); - static void propertynotify(XEvent *e); - static void quit(const Arg *arg); -+static void togglerealfull(const Arg *arg); - static Monitor *recttomon(int x, int y, int w, int h); - static void resize(Client *c, int x, int y, int w, int h, int interact); - static void resizeclient(Client *c, int x, int y, int w, int h); -@@ -564,9 +565,10 @@ configurenotify(XEvent *e) - drw_resize(drw, sw, bh); - updatebars(); - for (m = mons; m; m = m->next) { -- for (c = m->clients; c; c = c->next) -- if (c->isfullscreen) -- resizeclient(c, m->mx, m->my, m->mw, m->mh); -+ if (realfullscreen) -+ for (c = m->clients; c; c = c->next) -+ if (c->isfullscreen) -+ resizeclient(c, m->mx, m->my, m->mw, m->mh); - XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh); - } - focus(NULL); -@@ -1476,6 +1478,10 @@ setfullscreen(Client *c, int fullscreen) - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); - c->isfullscreen = 1; -+ -+ if (!realfullscreen) -+ return; -+ - c->oldstate = c->isfloating; - c->oldbw = c->bw; - c->bw = 0; -@@ -1486,6 +1492,10 @@ setfullscreen(Client *c, int fullscreen) - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)0, 0); - c->isfullscreen = 0; -+ -+ if (!realfullscreen) -+ return; -+ - c->isfloating = c->oldstate; - c->bw = c->oldbw; - c->x = c->oldx; -@@ -1618,7 +1628,7 @@ showhide(Client *c) - if (ISVISIBLE(c)) { - /* show clients top down */ - XMoveWindow(dpy, c->win, c->x, c->y); -- if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen) -+ if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !realfullscreen && !c->isfullscreen) - resize(c, c->x, c->y, c->w, c->h, 0); - showhide(c->snext); - } else { -@@ -1719,6 +1729,12 @@ togglefloating(const Arg *arg) - arrange(selmon); - } - -+void -+togglerealfull(const Arg *arg) -+{ -+ realfullscreen = ~realfullscreen; -+} -+ - void - toggletag(const Arg *arg) - { diff --git a/.sys/etc/portage/patches/x11-wm/dwm/hide_vacant_tags-git-2018-03-24.patch b/.sys/etc/portage/patches/x11-wm/dwm/hide_vacant_tags-git-2018-03-24.patch @@ -1,52 +0,0 @@ -diff --git a/dwm.c b/dwm.c -index c98678d..034ecc0 100644 ---- a/dwm.c -+++ b/dwm.c -@@ -416,7 +416,7 @@ attachstack(Client *c) - void - buttonpress(XEvent *e) - { -- unsigned int i, x, click; -+ unsigned int i, x, click, occ = 0; - Arg arg = {0}; - Client *c; - Monitor *m; -@@ -431,9 +431,13 @@ buttonpress(XEvent *e) - } - if (ev->window == selmon->barwin) { - i = x = 0; -- do -+ for (c = m->clients; c; c = c->next) -+ occ |= c->tags == 255 ? 0 : c->tags; -+ do { -+ if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) -+ continue; - x += TEXTW(tags[i]); -- while (ev->x >= x && ++i < LENGTH(tags)); -+ } while (ev->x >= x && ++i < LENGTH(tags)); - if (i < LENGTH(tags)) { - click = ClkTagBar; - arg.ui = 1 << i; -@@ -709,19 +713,17 @@ drawbar(Monitor *m) - } - - for (c = m->clients; c; c = c->next) { -- occ |= c->tags; -+ occ |= c->tags == 255 ? 0 : c->tags; - if (c->isurgent) - urg |= c->tags; - } - x = 0; - for (i = 0; i < LENGTH(tags); i++) { -+ if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) -+ continue; - 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); -- if (occ & 1 << i) -- drw_rect(drw, x + boxs, boxs, boxw, boxw, -- m == selmon && selmon->sel && selmon->sel->tags & 1 << i, -- urg & 1 << i); - x += w; - } - w = blw = TEXTW(m->ltsymbol); diff --git a/.sys/etc/portage/savedconfig/x11-wm/dwm-9999 b/.sys/etc/portage/savedconfig/x11-wm/dwm-9999 @@ -1,160 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* Allow use of special keys */ -#include <X11/XF86keysym.h> - -/* appearance */ -static const unsigned int borderpx = 1; /* border pixel of windows */ -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[] = { { "あんずもじ:style=Regular:size=18" }, - { "Go Mono:style=bold:size=14" }, - { "Source Han Sans JP:style=Medium:size=14" }, - { "Source Han Sans CN:style=Medium:size=14" }, - { "Source Han Sans KR:style=Medium:size=14" } }; -static const char dmenufont[] = "Go Mono:style=bold:size=14"; -static const char col_gray1[] = "#090909"; -static const char col_gray2[] = "#1b1b1b"; -static const char col_gray3[] = "#666666"; -static const char col_gray4[] = "#999999"; -static const char col_cyan[] = "#444444"; -static const char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = { col_gray3, col_gray1, col_gray1 }, - [SchemeSel] = { col_gray4, col_gray1, col_cyan }, -}; -static int realfullscreen = 0; - -/* 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 isfloating monitor */ - { "Gimp", NULL, NULL, 4, 1, -1 }, - { "mgba-sdl", NULL, NULL, 0, 1, -1 }, -/* { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, */ -}; - -/* layout(s) */ -static const float mfact = 0.60; /* factor of master area size [0.05..0.95] */ -static const int nmaster = 1; /* number of clients in master area */ -static const int resizehints = 0; /* 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 }, - { "TTT", bstack }, - { "===", bstackhoriz }, -}; - -/* key definitions */ -#define MODKEY Mod1Mask -#define WINKEY 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", "-i", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_gray1, "-sf", col_gray4, NULL }; -static const char *termcmd[] = { "tabbed", "-r", "2", "st", "-w", "''", NULL }; -/* static const char *volupcmd[] = { "amixer", "-q", "set", "Speaker", "2+", NULL }; - * static const char *voldncmd[] = { "amixer", "-q", "set", "Speaker", "2-", NULL }; - * static const char *volmucmd[] = { "amixer", "-q", "set", "Speaker", "toggle", NULL }; - */ -static const char *volmucmd[] = { "amixer", "-q", "set", "IEC958", "toggle", NULL }; -static const char *mpdtog[] = { "mpdtoggle", NULL }; -static const char *mpdnext[] = { "mpdnext", NULL }; -static const char *mpdprev[] = { "mpdprev", NULL }; -static const char *lock[] = { "slock", NULL }; -static const char *rotleft[] = { "/home/opask/bin/rotatemon", "DP-1", "left", NULL }; -static const char *rotnorm[] = { "/home/opask/bin/rotatemon", "DP-1", "normal", NULL }; -static const char *rebootcmd[] = { "doas", "/sbin/shutdown", "-r", "now", NULL }; -static const char *quitcmd[] = { "doas", "/sbin/shutdown", "-h", "now", NULL }; -static const char *sleepcmd[] = { "doas", "/usr/l/bin/zzz", NULL }; - -static Key keys[] = { - /* modifier key function argument */ -/* { 0, XF86XK_AudioRaiseVolume, spawn, {.v = volupcmd } }, - * { 0, XF86XK_AudioLowerVolume, spawn, {.v = voldncmd } }, - */ - { 0, XF86XK_AudioMute, spawn, {.v = volmucmd } }, - { 0, XF86XK_AudioPlay, spawn, {.v = mpdtog } }, - { 0, XF86XK_AudioNext, spawn, {.v = mpdnext } }, - { 0, XF86XK_AudioPrev, spawn, {.v = mpdprev } }, - { MODKEY|ShiftMask, XK_l, spawn, {.v = lock } }, - { WINKEY|ShiftMask, XK_p, spawn, {.v = quitcmd } }, - { WINKEY|ShiftMask, XK_r, spawn, {.v = rebootcmd } }, - { WINKEY|ShiftMask, XK_z, spawn, {.v = sleepcmd } }, - { WINKEY|ShiftMask, XK_9, spawn, {.v = rotleft } }, - { WINKEY|ShiftMask, XK_0, spawn, {.v = rotnorm } }, - { WINKEY|ShiftMask, XK_2, spawn, SHCMD("xscreenshot | ff2png > ~/media/pic/screengrabs/$(date -u +%Y年%m月%d日%T).png") }, - { WINKEY|ShiftMask, XK_3, spawn, SHCMD("xscreenshot $(pfw) | ff2png > ~/media/pic/screengrabs/$(date -u +%Y年%m月%d日%T).png") }, - { ControlMask, XK_space, spawn, SHCMD("kill $(pgrep -n notify)") }, - { 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.01} }, - { MODKEY, XK_l, setmfact, {.f = +0.01} }, - { 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_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 } }, - { 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 } }, - 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} }, - { MODKEY|ShiftMask, XK_y, togglerealfull, {0} }, -}; - -/* button definitions */ -/* click can be 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} }, -}; - diff --git a/src/c/dwm b/src/c/dwm @@ -0,0 +1 @@ +Subproject commit ed9d20621abaf7fecba980b33d55608078cef62e