add a few options, fix swallow, remove useless rules

This commit is contained in:
speedie 2022-11-12 14:42:02 +01:00
parent 60646c2a2f
commit d39fce6953
5 changed files with 27 additions and 14 deletions

View file

@ -44,6 +44,7 @@
!! Client options
!@
- speedwm.client.allowurgent: 1 ! Allow windows to have the 'urgent' status (0/1)
- speedwm.client.automove: 0 ! Allow windows to move themselves on demand. This may be annoying depending on what software you use and is disabled by default for this reason (0/1)
- speedwm.client.autofocus: 0 ! Allow windows to focus themselves on demand. This may be annoying depending on what software you use and is disabled by default for this reason (0/1)
- speedwm.client.autoresize: 0 ! Allow windows to resize themselves on demand (0/1)
- speedwm.client.decorhints: 1 ! Respect decoration hints for windows (0/1)

View file

@ -129,6 +129,7 @@ static int startontag = 1; /* Start on a tag or not? */
static int floatscratchpad = 0; /* Float the scratchpad window on hide (1/0) */
static int focusspawn = 0; /* Automatically focus the next spawned window. If warp is enabled, this is useless and will be disabled. (1/0) */
static int autofocus = 0; /* Allow clients to automatically be focused when they request it. This comes with the side effect of potentially being annoying */
static int automove = 0; /* Allow clients to automatically move when they request it */
static int autoresize = 0; /* Allow resizing clients automatically when they request it. */
/* Font options

View file

@ -22,18 +22,13 @@
static const Rule rules[] = {
/* class instance title tags mask isfloating ispermanent isterminal noswallow monitor unmanaged ignoretransient float x,y,w,h scratch key */
{ TERMINAL_CLASS, NULL, NULL, 0, 0, 0, 1, 0, -1, 0, 0, -1, 0 },
{ TERMINAL_CLASS, NULL, "sxiv", 0, 0, 0, 0, 0, -1, 0, 0, -1, 0 },
{ TERMINAL_CLASS, NULL, "Vifm", 0, 0, 0, 1, 0, -1, 0, 0, -1, 0 },
{ "Zathura", NULL, NULL, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0 },
{ TERMINAL_CLASS, NULL, "nvim", 0, 0, 0, 1, 1, -1, 0, 0, -1, 0 },
{ TERMINAL_CLASS, NULL, "cmus", 0, 0, 0, 0, 1, -1, 0, 0, -1, 0 },
{ TERMINAL_CLASS, NULL, notitle, 0, 0, 0, 0, 1, -1, 0, 0, -1, 0 },
{ "qutebrowser", NULL, NULL, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0 },
{ "Navigator", NULL, NULL, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0 },
{ "mpv", NULL, NULL, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0 },
{ "tabbed", NULL, NULL, 0, 0, 0, 0, 1, -1, 0, 0, -1, 0 },
{ "trayer", NULL, NULL, 0, 1, 1, 0, 1, -1, 1, 0, -1, 0 },
{ "Gsimplecal", NULL, NULL, 0, 1, 1, 0, 1, -1, 0, 0, -1, 0 },
{ "Gsimplecal", NULL, NULL, 0, 1, 0, 0, 1, -1, 0, 0, -1, 0 },
{ NULL, NULL, "CustomizeMii 3.11 by Leathl", 0, 1, 0, 0, 1, -1, 0, 0, -1, 0 },
{ NULL, NULL, "Picture-in-Picture", 0, 1, 0, 0, 1, -1, 0, 0, -1, 0 },
{ NULL, NULL, "About GNU IceCat", 0, 1, 0, 0, 1, -1, 0, 0, -1, 0 },

View file

@ -5202,12 +5202,19 @@ setclientstate(Client *c, long state)
}
void
setcurrentdesktop(void){
if (!automove)
return;
long data[] = { 0 };
XChangeProperty(dpy, root, netatom[NetCurrentDesktop], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1);
}
void
setdesktopnames(void)
{
if (!automove)
return;
XTextProperty text;
Xutf8TextListToTextProperty(dpy, tags, TAGSLENGTH, XUTF8StringStyle, &text);
XSetTextProperty(dpy, root, &text, netatom[NetDesktopNames]);
@ -5274,6 +5281,10 @@ sendevent(Client *c, Atom proto)
void
setnumdesktops(void){
if (!automove)
return;
long data[] = { TAGSLENGTH };
XChangeProperty(dpy, root, netatom[NetNumberOfDesktops], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1);
}
@ -5552,6 +5563,10 @@ setup(void)
void
setviewport(void){
if (!automove)
return;
long data[] = { 0, 0 };
XChangeProperty(dpy, root, netatom[NetDesktopViewport], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 2);
}
@ -6090,15 +6105,10 @@ togglefloating(const Arg *arg)
if (selmon->sel->isfloating)
{
if (savefloat)
{
/* restore last known float dimensions */
resize(selmon->sel, selmon->sel->sfx, selmon->sel->sfy, selmon->sel->sfw, selmon->sel->sfh, False);
}
else
{
resize(selmon->sel, selmon->sel->x, selmon->sel->y, selmon->sel->w, selmon->sel->h, 0);
}
}
else
{
selmon->sel->sfx = selmon->sel->x;
@ -6346,7 +6356,12 @@ updateclientlist()
(unsigned char *) &(c->win), 1);
}
void updatecurrentdesktop(void){
void
updatecurrentdesktop(void){
if (!automove)
return;
long rawdata[] = { selmon->tagset[selmon->seltags] };
int i=0;
while(*rawdata >> (i+1)){

View file

@ -125,6 +125,7 @@ ResourcePref resources[] = {
{ "client.floatscratchpad", INTEGER, &floatscratchpad },
{ "bar.altbar", INTEGER, &altbar },
{ "client.autofocus", INTEGER, &autofocus },
{ "client.automove", INTEGER, &automove },
{ "client.autoresize", INTEGER, &autoresize },
{ "mfact", FLOAT, &mfact },
{ "mfact.lowest", FLOAT, &lowestmfact },