LukeSmithxyz / dwm

Luke's build of dwm
MIT License
800 stars 532 forks source link

how to use the environment variable for window rules #244

Open nitrogenxx opened 3 weeks ago

nitrogenxx commented 3 weeks ago

Hi.. i apologizes i don't know i should ask this question here or not

today i though i should change my all the application into environment variable and then use that environment variable thought out the system.. instead of hardcore the application name on 1000 different place

but when i try to configure the environment variable for window rules in the config.h i am having some trouble

i tried many different method but non of then working for example :

when i try to change my terminal into environment variable and then use that environment veritable in the window rules in config.h by using this DWM patch environmentvars

i found this patch is not working for the window rules like


#define TERMINAL_ENVVAR "TERMINAL" // use: terminalcmd

static const Rule rules[] = {

    /* class                            instance    title       tags mask   switchtag  iscentered   isfloating   monitor */
    { terminalcmd,                   NULL,     NULL,       1 << 1,          1,                     0,               0,                -1 },

    };

but this patch is only working for keybindings like

      { MODKEY,                XK_c,             spawn,           {.v = terminalcmd} },

i think this patch is only designed to work with keybinding but with window rules i tried same thing with multiple application but they are working for keybinding but not working for window rules

i tried many different method non of them are working for window rules like example :


static const Rule rules[] = {

    /* class                            instance    title       tags mask   switchtag  iscentered   isfloating   monitor */
    {  SHCMD("$TERMINAL"),  NULL,     NULL,       1 << 1,          1,                     0,               0,                -1 },
     {  $TERMINAL,           NULL,     NULL,       1 << 2,          1,                     0,               0,                -1 }

    };

I'm looking for the guidance how to use the environment variable for window rules i will really appreciate your willingness to help or any inside possible 🙆

i really apologize if i shouldn't ask this question here ... pink heart emoji