diff options
author | zachir <zachir@librem.one> | 2020-11-11 19:11:36 -0600 |
---|---|---|
committer | zachir <zachir@librem.one> | 2020-11-11 19:11:36 -0600 |
commit | 6b84649570e7cce23bbbe4436cdbbc8c39dc1cb2 (patch) | |
tree | f2ad67b4741836934ba941bd04b44603749b0ba8 | |
parent | 5bbd9d32886c6318e61be291181ce7b27b3ffb68 (diff) |
Update to latest config
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | config.def.h | 3 | ||||
-rw-r--r-- | config.h | 28 | ||||
-rw-r--r-- | dwm.1 | 223 | ||||
-rw-r--r-- | dwm.c | 34 | ||||
-rw-r--r-- | patches/dwm-cfacts-20200913-61bb8b2.diff | 117 | ||||
-rwxr-xr-x | volsv | 21 |
7 files changed, 373 insertions, 57 deletions
@@ -38,7 +38,7 @@ dist: clean install: all mkdir -p ${DESTDIR}${PREFIX}/bin - cp -f dwm dwmc ${DESTDIR}${PREFIX}/bin + cp -f dwm dwmc volsv ${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 +46,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 70c180b..8bfef3e 100644 --- a/config.def.h +++ b/config.def.h @@ -79,6 +79,9 @@ static Key keys[] = { { MODKEY, XK_d, incnmaster, {.i = -1 } }, { MODKEY, XK_h, setmfact, {.f = -0.05} }, { MODKEY, XK_l, setmfact, {.f = +0.05} }, + { MODKEY|ShiftMask, XK_h, setcfact, {.f = +0.25} }, + { MODKEY|ShiftMask, XK_l, setcfact, {.f = -0.25} }, + { MODKEY|ShiftMask, XK_o, setcfact, {.f = 0.00} }, { MODKEY, XK_Return, zoom, {0} }, { MODKEY, XK_Tab, view, {0} }, { MODKEY|ShiftMask, XK_c, killclient, {0} }, @@ -19,7 +19,7 @@ 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[] = "#005577"; +static const char col_cyan[] = "#750000"; static const char *colors[][3] = { /* fg bg border */ [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, @@ -40,7 +40,10 @@ static const Rule rules[] = { { "Gimp", NULL, NULL, 0, 1, 0, 0, -1 }, { "Firefox", NULL, NULL, 1 << 8, 0, 0, 1, -1 }, { "st-256color",NULL, NULL, 0, 0, 1, 1, -1 }, - { "tabbed", NULL, NULL, 0, 0, 1, 0, -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 }, @@ -50,6 +53,7 @@ static const Rule rules[] = { { NULL, NULL, "Event Tester", 0, 1, 0, 1, -1 }, /* xev */ { "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 }, }; @@ -82,8 +86,8 @@ static const Layout layouts[] = { 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 *passmenu[] = { "passmenu", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; -//static const char *termcmd[] = { "tabbed", "-c", "st", "-w", NULL }; static const char *termcmd[] = { "tabbed", "-c", "st", "-w", NULL }; +//static const char *termcmd[] = { "dmenuabduco", 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 }; @@ -96,14 +100,16 @@ 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[] = { "i3lock-fancy", NULL }; +static const char *lockscr[] = { "xautolock", "-locknow", 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_p, spawn, {.v = passmenu } }, { MODKEY, XK_c, spawn, {.v = xidletog } }, + { MODKEY, XK_x, spawn, {.v = xkillcmd } }, { MODKEY, XK_Return, spawn, {.v = termcmd } }, { 0, XF86XK_AudioPlay, spawn, {.v = mpdtoggle } }, { 0, XF86XK_AudioNext, spawn, {.v = mpdnext } }, @@ -119,22 +125,28 @@ static Key keys[] = { { 0, XF86XK_AudioMicMute, spawn, {.v = micmute } }, { Mod4Mask, XK_l, spawn, {.v = lockscr } }, { MODKEY, XK_b, togglebar, {0} }, - { MODKEY|ShiftMask, XK_j, pushdown, {.i = +1 } }, - { MODKEY|ShiftMask, XK_k, pushup, {.i = -1 } }, { 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_j, setcfact, {.f = +0.25} }, + { MODKEY|ControlMask, XK_k, setcfact, {.f = -0.25} }, + { MODKEY|ControlMask, XK_o, setcfact, {.f = 0.00} }, { MODKEY, XK_comma, incnmaster, {.i = +1 } }, { MODKEY, XK_period, incnmaster, {.i = -1 } }, { MODKEY, XK_h, setmfact, {.f = -0.05} }, { MODKEY, XK_l, setmfact, {.f = +0.05} }, + { MODKEY|ShiftMask, XK_h, setcfact, {.f = +0.25} }, + { MODKEY|ShiftMask, XK_l, setcfact, {.f = -0.25} }, + { MODKEY|ShiftMask, XK_o, setcfact, {.f = 0.00} }, { 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_space, setlayout, {0} }, - { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, + { 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 } }, @@ -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. .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,10 +25,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 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 @@ -59,41 +60,107 @@ 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. +.B Mod1\-c +Spawn xidletog to change caffeine/xautolock state. .TP -.B Mod1\-. -Focus next screen, if any. +.B Mod1\-x +Spawn +.BR xkill(1) +to kill any selected window. .TP -.B Mod1\-Shift\-, -Send focused window to previous screen, if any. +.B AudioPlay +Spawn +.BR playerctl(1) +to toggle (in order, if not found) +.BR mpd(1), +.BR mpv(1), +or any other MPRIS compatible media player .TP -.B Mod1\-Shift\-. -Send focused window to next screen, if any. +.B AudioNext +Spawn +.BR playerctl(1) +to go to next track of (in order, if not found) +.BR mpd(1), +.BR mpv(1), +or any other MPRIS compatible media player .TP -.B Mod1\-b -Toggles bar on and off. +.B AudioPrev +Spawn +.BR playerctl(1) +to go to previous track of (in order, if not found) +.BR mpd(1), +.BR mpv(1), +or any other MPRIS compatible media player .TP -.B Mod1\-t -Sets tiled layout. +.B Shift\-AudioPlay +Spawn +.BR playerctl(1) +to toggle (in order, if not found) any other MPRIS compatible media player, pr +.BR mpd(1). .TP -.B Mod1\-f -Sets floating layout. +.B Shift\-AudioNext +Spawn +.BR playerctl(1) +to skip forward in (in order, if not found) any other MPRIS compatible media player, pr +.BR mpd(1). .TP -.B Mod1\-m -Sets monocle layout. +.B Shift\-AudioPrev +Spawn +.BR playerctl(1) +to toggle (in order, if not found) any other MPRIS compatible media player, pr +.BR mpd(1). .TP -.B Mod1\-space -Toggles between current and previous layout. +.B MonBrightnessUp +Spawn +.BR light(1) +to turn the backlight brightness up +.TP +.B MonBrightnessDown +Spawn +.BR light(1) +to turn the backlight brightness down +.TP +.B AudioLowerVolume +Spawn volsv to turn the volume (pulseaudio first, alsa if not found) down +.TP +.B AudioRaiseVolume +Spawn volsv to turn the volume (pulseaudio first, alsa if not found) up +.TP +.B AudioMute +Spawn volsv to mute the volume (pulseaudio first, alsa if not found) +.TP +.B AudioMicMute +Spawn +.BR pamixer(1) +to mute the microphone. +.TP +.B Mod4\-l +Spawn +.BR i3lock-fancy(1) +to lock the screen. +.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. @@ -101,53 +168,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. .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 Quit dwm. .TP -.B Mod1\-Control\-Shift\-q +.B Mod1\-Shift\-r Restart dwm. +.TP +.B Mod1\-Shift\-Tab +Toggle AttachBelow patch .SS Mouse commands .TP .B Mod1\-Button1 @@ -168,6 +273,34 @@ 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) @@ -107,6 +107,7 @@ typedef struct Client Client; struct Client { char name[256]; float mina, maxa; + float cfact; int x, y, w, h; int oldx, oldy, oldw, oldh; int basew, baseh, incw, inch, maxw, maxh, minw, minh; @@ -250,6 +251,7 @@ static void setclientstate(Client *c, long state); static void setfocus(Client *c); static void setfullscreen(Client *c, int fullscreen); static void setlayout(const Arg *arg); +static void setcfact(const Arg *arg); static void setmfact(const Arg *arg); static void setup(void); static void seturgent(Client *c, int urg); @@ -1369,6 +1371,7 @@ manage(Window w, XWindowAttributes *wa) c->w = c->oldw = wa->width; c->h = c->oldh = wa->height; c->oldbw = wa->border_width; + c->cfact = 1.0; updatetitle(c); if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { @@ -2002,6 +2005,23 @@ setlayout(const Arg *arg) drawbar(selmon); } +void setcfact(const Arg *arg) { + float f; + Client *c; + + c = selmon->sel; + + if(!arg || !c || !selmon->lt[selmon->sellt]->arrange) + return; + f = arg->f + c->cfact; + if(arg->f == 0.0) + f = 1.0; + else if(f < 0.25 || f > 4.0) + return; + c->cfact = f; + arrange(selmon); +} + /* arg > 1.0 will set mfact absolutely */ void setmfact(const Arg *arg) @@ -2208,9 +2228,15 @@ void tile(Monitor *m) { unsigned int i, n, h, mw, my, ty; + float mfacts = 0, sfacts = 0; Client *c; - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); + for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) { + if (n < m->nmaster) + mfacts += c->cfact; + else + sfacts += c->cfact; + } if (n == 0) return; @@ -2220,13 +2246,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); + 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); + sfacts -= c->cfact; } } diff --git a/patches/dwm-cfacts-20200913-61bb8b2.diff b/patches/dwm-cfacts-20200913-61bb8b2.diff new file mode 100644 index 0000000..bb70e13 --- /dev/null +++ b/patches/dwm-cfacts-20200913-61bb8b2.diff @@ -0,0 +1,117 @@ +From c32a879432573d71dec7fcb4bf68927d2f4cdf10 Mon Sep 17 00:00:00 2001 +From: iofq <cjriddz@protonmail.com> +Date: Sat, 12 Sep 2020 22:28:09 -0500 +Subject: [PATCH] Fixed 'cfacts' patch failure due to upstream commit + 'f09418bbb...' + +--- + config.def.h | 3 +++ + dwm.c | 34 +++++++++++++++++++++++++++++++--- + 2 files changed, 34 insertions(+), 3 deletions(-) + +diff --git a/config.def.h b/config.def.h +index 1c0b587..83910c1 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -70,6 +70,9 @@ static Key keys[] = { + { MODKEY, XK_d, incnmaster, {.i = -1 } }, + { MODKEY, XK_h, setmfact, {.f = -0.05} }, + { MODKEY, XK_l, setmfact, {.f = +0.05} }, ++ { MODKEY|ShiftMask, XK_h, setcfact, {.f = +0.25} }, ++ { MODKEY|ShiftMask, XK_l, setcfact, {.f = -0.25} }, ++ { MODKEY|ShiftMask, XK_o, setcfact, {.f = 0.00} }, + { MODKEY, XK_Return, zoom, {0} }, + { MODKEY, XK_Tab, view, {0} }, + { MODKEY|ShiftMask, XK_c, killclient, {0} }, +diff --git a/dwm.c b/dwm.c +index 664c527..5233229 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -87,6 +87,7 @@ typedef struct Client Client; + struct Client { + char name[256]; + float mina, maxa; ++ float cfact; + int x, y, w, h; + int oldx, oldy, oldw, oldh; + int basew, baseh, incw, inch, maxw, maxh, minw, minh; +@@ -201,6 +202,7 @@ static void setclientstate(Client *c, long state); + static void setfocus(Client *c); + static void setfullscreen(Client *c, int fullscreen); + static void setlayout(const Arg *arg); ++static void setcfact(const Arg *arg); + static void setmfact(const Arg *arg); + static void setup(void); + static void seturgent(Client *c, int urg); +@@ -1030,6 +1032,7 @@ manage(Window w, XWindowAttributes *wa) + c->w = c->oldw = wa->width; + c->h = c->oldh = wa->height; + c->oldbw = wa->border_width; ++ c->cfact = 1.0; + + updatetitle(c); + if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { +@@ -1512,6 +1515,23 @@ setlayout(const Arg *arg) + drawbar(selmon); + } + ++void setcfact(const Arg *arg) { ++ float f; ++ Client *c; ++ ++ c = selmon->sel; ++ ++ if(!arg || !c || !selmon->lt[selmon->sellt]->arrange) ++ return; ++ f = arg->f + c->cfact; ++ if(arg->f == 0.0) ++ f = 1.0; ++ else if(f < 0.25 || f > 4.0) ++ return; ++ c->cfact = f; ++ arrange(selmon); ++} ++ + /* arg > 1.0 will set mfact absolutely */ + void + setmfact(const Arg *arg) +@@ -1675,9 +1695,15 @@ void + tile(Monitor *m) + { + unsigned int i, n, h, mw, my, ty; ++ float mfacts = 0, sfacts = 0; + Client *c; + +- for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); ++ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) { ++ if (n < m->nmaster) ++ mfacts += c->cfact; ++ else ++ sfacts += c->cfact; ++ } + if (n == 0) + return; + +@@ -1687,15 +1713,17 @@ 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); + if (my + HEIGHT(c) < m->wh) + 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); + if (ty + HEIGHT(c) < m->wh) + ty += HEIGHT(c); ++ sfacts -= c->cfact; + } + } + +-- +2.28.0 + @@ -0,0 +1,21 @@ +#!/bin/sh +# if pulseaudio +pulsesv () { + case "$1" in + "up" | "-i") pamixer -i 5 ;; + "down" | "-d") pamixer -d 5 ;; + "toggle" | "-t") pamixer -t ;; + "mic" | "-m") pamixer --source 1 -t ;; + esac +} +# if alsa +alsasv () { + case "$1" in + "up" | "-i") amixer sset Master 5%+ ;; + "down" | "-d") amixer sset Master 5%- ;; + "toggle" | "-t") amixer sset Master toggle ;; + "mic" | "-m") amixer set Capture toggle ;; + esac +} +# check which it is +[ ! -z "$(pgrep pulseaudio)" ] && pulsesv $1 || alsasv $1 ; pkill -RTMIN+10 dwmblocks ; touch /tmp/volsv.tmp |