Update: Add lowest mfact float

This commit is contained in:
speediegq 2022-09-17 00:45:58 +02:00
parent c0428306dc
commit bcfbc2e218
4 changed files with 22 additions and 2 deletions

View file

@ -8,6 +8,7 @@
!!
!! Fonts are picked based on (A) order in the list below and (B) what fonts have the character that should be printed.
!! If you want more than three fonts, add a comma to font3 and add another to it.
!!
- speedwm.font: NotoSans-Regular:size=8:antialiasing=true
- speedwm.font2: fontawesome:size=8
- speedwm.font3: Noto Color Emoji:size=8
@ -103,6 +104,10 @@
!!
- speedwm.mfact: 0.50
!!
!! Lowest possible mfact.
!!
- speedwm.lowestmfact: 0.05
!!
!! Start on tag. If this is set to 1, speedwm will start on tag 1. If it is set to 0, then speedwm will not start on tag 1. (1/0)
!!
- speedwm.startontag: 1

View file

@ -118,6 +118,7 @@ static int refreshrules = 1; /* Refresh rules when a CLASS
static int i3nmaster = 0; /* Enable i3-gaps like nmaster (1/0) */
static int mousemfact = 1; /* Enable adjusting mfact using the mouse (1/0) */
static float mfact = 0.50; /* Default mfact value. 0.50 = each gets half the available space */
static float lowestmfact = 0.05; /* Lowest possible mfact value on top of the existing. */
/* Window gap options */
static int enablegaps = 1; /* Enable gaps */
@ -216,6 +217,7 @@ static int barheight = 5; /* Bar height in px, 0 = calc
static int barposition = 1; /* Bar position. Top: 0, Bottom: 1 */
static int barpaddingv = 10; /* How much padding to have vertically in pixels */
static int barpaddingh = 10; /* How much padding to have horizontally in pixels */
static int barpaddinggaps = 1; /* Set barpadding to the gaps */
static int leftlayout = 1; /* Layout indicator on the left (1) or on the right (0) */
/* Tag text options */

View file

@ -620,6 +620,10 @@ static xcb_connection_t *xcon;
/* Modifiers */
#define CONTROL ControlMask
#define SHIFT ShiftMask
#define ALT Mod1Mask
#define ALTR Mod3Mask
#define SUPER Mod4Mask
#define SHIFTL Mod5Mask
/* Rest of the headers */
@ -2573,6 +2577,11 @@ void
togglegaps(const Arg *arg)
{
enablegaps = !enablegaps;
if (barpaddingv != 0 && barpaddingh != 0 && barpaddinggaps && enablegaps) {
updatebarpos(selmon);
}
arrange(selmon);
}
@ -4081,7 +4090,7 @@ setmfact(const Arg *arg)
if (!arg || !selmon->lt[selmon->sellt]->arrange)
return;
f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
if (f < 0.05 || f > 0.95)
if (f < 0.05 - lowestmfact || f > 0.95 + lowestmfact )
return;
selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag] = f;
arrange(selmon);
@ -4722,7 +4731,10 @@ updatebarpos(Monitor *m)
{
m->wy = m->my;
m->wh = m->mh;
if (m->showbar) {
if (barpaddingv != 0 && barpaddingh != 0 && barpaddinggaps && enablegaps) {
barpaddingv = gappov;
barpaddingh = gappoh;
} if (m->showbar) {
m->wh = m->wh - barpaddingv - m->bh;
m->by = m->barposition ? m->wy : m->wy + m->wh + barpaddingv;
m->wy = m->barposition ? m->wy + m->bh + vp : m->wy;

View file

@ -195,5 +195,6 @@ ResourcePref resources[] = {
{ "floatscratchpad", INTEGER, &floatscratchpad },
{ "altbar", INTEGER, &altbar },
{ "mfact", FLOAT, &mfact },
{ "lowestmfact", FLOAT, &lowestmfact },
/* value in .Xresources type value in speedwm */
};