Re: [dev] [dwm] How do I launch a window in floating mode without using `Rules rules[]`?

From: Enan Ajmain <3nan.ajmain_AT_gmail.com>
Date: Wed, 15 May 2019 06:40:05 +0600

On Wed, May 15, 2019 at 2:09 AM Felix Van der Jeugt
<felix.vanderjeugt_AT_gmail.com> wrote:
>
> Dear Enan Ajmain,
>
> Quoting Enan Ajmain (2019-05-14 13:00:34)
> > I want to add a keybinding to launch my terminal emulator in floating
> > mode, and I want it to be separate from my regular keybinding to
> > launch terminal in the currently active mode. If I wanted to launch
> > the terminal window always in floating mode, I could have used rules.
> >
> > I've looked through config file and have a guess that the NULL entry
> > in the following list of strings might be used to indicate what mode I
> > want the window to open in.
> > ```
> > static const char *termcmd[] = { "st", NULL };
> > ```
> >
> > But after looking at the union Arg and the function spawn, I am
> > feeling lost. So, if anyone could point me in the right direction, it
> > would be great.
>
> This list of strings is the command passed to the spawn function.
>
> It'd be hard to set a window to floating before that window is actually
> created. When spawning a new terminal, there's no handle for that
> window yet. This handle is only created when X notifies dwm there's a
> new window.

That makes sense. I hadn't looked through the code deep enough. Thanks
for explaining.

> I guess you could modify the spawn function to set some variable
> indicating the next spawned window should float, and check this
> variable when that window actually appears. But I'd advise a
> workaround:
>
> You could add a second termcmd, bound to another key. This term would
> have a different window title/class (st has options for this), so you
> could add a rule for it.

I will give it a try.

> Sincerely,
> Felix
>
Received on Wed May 15 2019 - 02:40:05 CEST

This archive was generated by hypermail 2.3.0 : Wed May 15 2019 - 05:48:08 CEST