bakkeby / dwm-flexipatch

A dwm build with preprocessor directives to decide which patches to include during build time
MIT License
1.15k stars 233 forks source link

Set size for floating windows #66

Closed plasmoduck closed 3 years ago

plasmoduck commented 3 years ago

How can I set a floating windows size? I use MPlayer to watch YouTube videos from surf and sometimes they take up both monitors. I'd like to set it to a decent size for all videos. I currently use this rule in config.def.h: RULE(.class = "MPlayer", .tags = 0, .iscentered = 1, .isfloating = 1)

I did have a look at https://github.com/bakkeby/patches/wiki/floatpos but the structure is different to my rules.

bakkeby commented 3 years ago

Either you take the floatrules patch or you use the floatpos patch.

The Rule structure in a bare dwm looks like this:

typedef struct {
    const char *class;
    const char *instance;
    const char *title;
    unsigned int tags;
    int isfloating;
    int monitor;
} Rule;

and you can initialise all of these values at the same time using an array, e.g.

    /* class      instance    title       tags mask     isfloating   monitor */
    { "Gimp",     NULL,       NULL,       0,            1,           -1 },

or you can use the RULE macro as defined in dwm-flexipatch to only pass in the values that are not default.

#define RULE(...) { .monitor = -1, ##__VA_ARGS__ },

In your case you could just add something like .floatpos = "800W 500H".

plasmoduck commented 3 years ago

Perfect, just what I was looking for! .floatpos = "800W 500H". Thanks