From a4f72ccb0ef40d76b37a66823269c1919b0f86c7 Mon Sep 17 00:00:00 2001 From: coast Date: Thu, 29 May 2025 22:43:52 +0200 Subject: [PATCH] Upload files to ".suckless/patch" --- .suckless/patch/bar_tags.h | 4 +++ .suckless/patch/bar_wintitle.c | 48 ++++++++++++++++++++++++++++++++ .suckless/patch/bar_wintitle.h | 4 +++ .suckless/patch/cool_autostart.c | 29 +++++++++++++++++++ .suckless/patch/cool_autostart.h | 2 ++ 5 files changed, 87 insertions(+) create mode 100644 .suckless/patch/bar_tags.h create mode 100644 .suckless/patch/bar_wintitle.c create mode 100644 .suckless/patch/bar_wintitle.h create mode 100644 .suckless/patch/cool_autostart.c create mode 100644 .suckless/patch/cool_autostart.h diff --git a/.suckless/patch/bar_tags.h b/.suckless/patch/bar_tags.h new file mode 100644 index 0000000..70040d2 --- /dev/null +++ b/.suckless/patch/bar_tags.h @@ -0,0 +1,4 @@ +static int width_tags(Bar *bar, BarArg *a); +static int draw_tags(Bar *bar, BarArg *a); +static int click_tags(Bar *bar, Arg *arg, BarArg *a); +static int hover_tags(Bar *bar, BarArg *a, XMotionEvent *ev); diff --git a/.suckless/patch/bar_wintitle.c b/.suckless/patch/bar_wintitle.c new file mode 100644 index 0000000..d086736 --- /dev/null +++ b/.suckless/patch/bar_wintitle.c @@ -0,0 +1,48 @@ +int +width_wintitle(Bar *bar, BarArg *a) +{ + return a->w; +} + +int +draw_wintitle(Bar *bar, BarArg *a) +{ + int x = a->x + lrpad / 2, w = a->w - lrpad / 2; + Monitor *m = bar->mon; + Client *c = m->sel; + + if (!c) { + drw_setscheme(drw, scheme[SchemeTitleNorm]); + drw_rect(drw, x, a->y, w, a->h, 1, 1); + return 0; + } + + int tpad = lrpad / 2; + int tx = x; + int tw = w; + + drw_setscheme(drw, scheme[m == selmon ? SchemeTitleSel : SchemeTitleNorm]); + + if (w <= TEXTW("A") - lrpad + tpad) // reduce text padding if wintitle is too small + tpad = (w - TEXTW("A") + lrpad < 0 ? 0 : (w - TEXTW("A") + lrpad) / 2); + + XSetForeground(drw->dpy, drw->gc, drw->scheme[ColBg].pixel); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, a->y, w, a->h); + + + tx += tpad; + tw -= lrpad; + + + drw_text(drw, tx, a->y, tw, a->h, 0, c->name, 0, False); + + drawstateindicator(m, c, 1, x, a->y, w, a->h, 0, 0, c->isfixed); + return 1; +} + +int +click_wintitle(Bar *bar, Arg *arg, BarArg *a) +{ + return ClkWinTitle; +} + diff --git a/.suckless/patch/bar_wintitle.h b/.suckless/patch/bar_wintitle.h new file mode 100644 index 0000000..7e8cce5 --- /dev/null +++ b/.suckless/patch/bar_wintitle.h @@ -0,0 +1,4 @@ +static int width_wintitle(Bar *bar, BarArg *a); +static int draw_wintitle(Bar *bar, BarArg *a); +static int click_wintitle(Bar *bar, Arg *arg, BarArg *a); + diff --git a/.suckless/patch/cool_autostart.c b/.suckless/patch/cool_autostart.c new file mode 100644 index 0000000..ffd4ba3 --- /dev/null +++ b/.suckless/patch/cool_autostart.c @@ -0,0 +1,29 @@ +/* dwm will keep pid's of processes from autostart array and kill them at quit */ +static pid_t *autostart_pids; +static size_t autostart_len; + +/* execute command from autostart array */ +static void +autostart_exec() +{ + const char *const *p; + size_t i = 0; + + /* count entries */ + for (p = autostart; *p; autostart_len++, p++) + while (*++p); + + autostart_pids = malloc(autostart_len * sizeof(pid_t)); + for (p = autostart; *p; i++, p++) { + if ((autostart_pids[i] = fork()) == 0) { + setsid(); + execvp(*p, (char *const *)p); + fprintf(stderr, "dwm: execvp %s\n", *p); + perror(" failed"); + _exit(EXIT_FAILURE); + } + /* skip arguments */ + while (*++p); + } +} + diff --git a/.suckless/patch/cool_autostart.h b/.suckless/patch/cool_autostart.h new file mode 100644 index 0000000..5534d99 --- /dev/null +++ b/.suckless/patch/cool_autostart.h @@ -0,0 +1,2 @@ +static void autostart_exec(void); +