Revert previous commit for now, change keybinds

This commit is contained in:
speediegq 2022-10-04 18:12:17 +02:00
parent b5b8570f55
commit 970e66d573
6 changed files with 25 additions and 19 deletions

View file

@ -124,6 +124,10 @@
!!
- speedwm.focusspawn: 0
!!
!! Enable gaps around windows. Gaps make it easier to distinguish windows from each other and they look nice, but gives the user less space for windows. (1/0)
!!
- speedwm.enablegaps: 1
!!
!! Use different gaps when there is only one window on a tag. (1/0)
!!
- speedwm.smartgaps: 0
@ -335,6 +339,10 @@
!!
- speedwm.resetmfact: 1
!!
!! Reset gaps when there is only one window visible. If set to 1, the gaps will be reset to the default if there is only one window on the selected tag. (1/0)
!!
- speedwm.resetgaps: 1
!!
!! Workaround for when a class cannot be found. If set to 1, a workaround for when a class cannot be found will be enabled. Otherwise it will be disabled. (1/0)
!!
- speedwm.wmclass: 1

View file

@ -30,7 +30,7 @@
- Super+s | Show/hide the systray
- Super+j/k | Move focus between visible windows
- Super+m | Moves focus to the Master window (or back if Master is already focused)
- Super+Control+u/d | Increase/decrease gaps between windows by 5
- Super+Control+z/x | Increase/decrease gaps between windows by 5
- Super+Control+j/k | Move focus between hidden windows (Can then 'Show')
- Super+a/d | Increase/decrease size of each window
- Super+o | Hide a window

View file

@ -167,8 +167,8 @@ static const Key keys[] = {
{ MODIFIER1|SHIFT, XK_e, XK_e, spawn, RCMD("speedwm-virtualkeyboard -e") },
/* Gap keybinds */
{ MODIFIER1|CONTROL, -1, XK_d, incrgaps, {.i = +5 } },
{ MODIFIER1|CONTROL, -1, XK_u, incrgaps, {.i = -5 } },
{ MODIFIER1|CONTROL, -1, XK_z, incrgaps, {.i = +5 } },
{ MODIFIER1|CONTROL, -1, XK_x, incrgaps, {.i = -5 } },
/* Chained gap keybinds */
{ MODIFIER1, XK_g, XK_t, togglegaps, {0} },

View file

@ -116,6 +116,7 @@ static float mfact = 0.50; /* Default mfact value. 0.
static float lowestmfact = 0.05; /* Lowest possible mfact value on top of the existing. */
/* Window gap options */
static int enablegaps = 1; /* Enable gaps */
static unsigned int gappih = 10; /* Horizontal inner gap between windows */
static unsigned int gappiv = 10; /* Vertical inner gap between windows */
static unsigned int gappoh = 10; /* Horizontal outer gap between windows and screen edge */
@ -263,6 +264,7 @@ static int stairsamesize = 1; /* 1 means shrink all the sta
#endif
static int resetlayout = 1; /* Reset layout when there is only one client visible */
static int resetmfact = 1; /* Reset mfact when there is only one client visible */
static int resetgaps = 1; /* Reset gaps when there is only one client visible */
#if LAYOUT_DGRID
static int forcevsplit = 1; /* Force two clients to always split vertically in the dynamic grid layout */
#endif

View file

@ -716,9 +716,6 @@ struct Pertag {
unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */
const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */
int showbars[LENGTH(tags) + 1]; /* display bar for the current tag */
/* vanitygaps pertag */
int enablegaps[LENGTH(tags) + 1];
unsigned int gaps[LENGTH(tags) + 1];
};
/* compile-time check if all tags fit into an unsigned int bit array. */
@ -1416,7 +1413,7 @@ void drawroundedcorners(Client *c)
int width = borderpx * 2 + wa.width;
int height = borderpx * 2 + wa.height;
int rad = cornerradius;
int rad = cornerradius * enablegaps;
int dia = 2 * rad;
if(width < dia || height < dia)
@ -2652,10 +2649,6 @@ setgaps(int oh, int ov, int ih, int iv)
selmon->gappov = ov;
selmon->gappih = ih;
selmon->gappiv = iv;
/* pertag vanitygaps */
selmon->pertag->gaps[selmon->pertag->curtag] = ((oh & 0xFF) << 0) | ((ov & 0xFF) << 8) | ((ih & 0xFF) << 16) | ((iv & 0xFF) << 24);
arrange(selmon);
}
@ -2663,7 +2656,11 @@ void
getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int *nc)
{
unsigned int n, oe, ie;
#if PERTAG_PATCH
oe = ie = selmon->pertag->enablegaps[selmon->pertag->curtag];
#else
oe = ie = enablegaps;
#endif // PERTAG_PATCH
Client *c;
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
@ -2745,7 +2742,7 @@ togglewin(const Arg *arg)
void
togglegaps(const Arg *arg)
{
selmon->pertag->enablegaps[selmon->pertag->curtag] = !selmon->pertag->enablegaps[selmon->pertag->curtag];
enablegaps = !enablegaps;
arrange(selmon);
}
@ -3510,7 +3507,6 @@ resizemouse(const Arg *arg)
} else {
if (mousemfact) {
selmon->mfact = (double) (ev.xmotion.x_root - selmon->mx) / (double) selmon->ww;
/* vanitygaps pertag */
arrange(selmon);
XWarpPointer(dpy, None, root, 0, 0, 0, 0,
selmon->mx + (selmon->ww * selmon->mfact),
@ -3878,6 +3874,10 @@ reset_layout(const Arg *arg)
if (resetmfact) {
setmfact(&default_mfact);
}
if (enablegaps && resetgaps) {
defaultgaps(NULL);
}
}
void
@ -5563,12 +5563,6 @@ view(const Arg *arg)
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt];
selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1];
/* vanitygaps pertag */
selmon->gappoh = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff) >> 0;
selmon->gappov = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff00) >> 8;
selmon->gappih = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff0000) >> 16;
selmon->gappiv = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff000000) >> 24;
if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
togglebar(NULL);
}

View file

@ -138,6 +138,7 @@ ResourcePref resources[] = {
{ "statusallmons", INTEGER, &statusallmons },
{ "resetlayout", INTEGER, &resetlayout },
{ "resetmfact", INTEGER, &resetmfact },
{ "resetgaps", INTEGER, &resetgaps },
{ "wmclass", INTEGER, &wmclass },
{ "clicktofocus", INTEGER, &clicktofocus },
{ "urgentwindows", INTEGER, &urgentwindows },
@ -145,6 +146,7 @@ ResourcePref resources[] = {
{ "underlinepad", INTEGER, &underlinepad },
{ "underlinestroke", INTEGER, &underlinestroke },
{ "underlinevoffset", INTEGER, &underlinevoffset },
{ "enablegaps", INTEGER, &enablegaps },
{ "gappih", INTEGER, &gappih },
{ "gappiv", INTEGER, &gappiv },
{ "gappoh", INTEGER, &gappoh },