Added RULE macro to replace rules setup making the default config less of an abomination and making it simpler to include new rules based patches
This commit is contained in:
31
dwm.c
31
dwm.c
@ -323,6 +323,33 @@ typedef struct {
|
||||
int monitor;
|
||||
} Rule;
|
||||
|
||||
#define R_WINDOWROLERULE_(enabled) R_WINDOWROLERULE_##enabled
|
||||
#define R_WINDOWROLERULE(enabled) R_WINDOWROLERULE_(enabled)
|
||||
#define R_WINDOWROLERULE_0
|
||||
#define R_WINDOWROLERULE_1 .role = NULL,
|
||||
|
||||
#define R_SWITCHTAG_(enabled) R_SWITCHTAG_##enabled
|
||||
#define R_SWITCHTAG(enabled) R_SWITCHTAG_(enabled)
|
||||
#define R_SWITCHTAG_0
|
||||
#define R_SWITCHTAG_1 .switchtag = 0,
|
||||
|
||||
#define R_CENTER_(enabled) R_CENTER_##enabled
|
||||
#define R_CENTER(enabled) R_CENTER_(enabled)
|
||||
#define R_CENTER_0
|
||||
#define R_CENTER_1 .iscentered = 0,
|
||||
|
||||
#define R_ISPERMANENT_(enabled) R_ISPERMANENT_##enabled
|
||||
#define R_ISPERMANENT(enabled) R_ISPERMANENT_(enabled)
|
||||
#define R_ISPERMANENT_0
|
||||
#define R_ISPERMANENT_1 .ispermanent = 0,
|
||||
|
||||
#define R_SWALLOW_(enabled) R_SWALLOW_##enabled
|
||||
#define R_SWALLOW(enabled) R_SWALLOW_(enabled)
|
||||
#define R_SWALLOW_0
|
||||
#define R_SWALLOW_1 .isterminal = 0, .noswallow = 1,
|
||||
|
||||
#define RULE(...) { .class = NULL, R_WINDOWROLERULE(WINDOWROLERULE_PATCH) .instance = NULL, .title = NULL, .tags = 0, R_SWITCHTAG(SWITCHTAG_PATCH) R_CENTER(CENTER_PATCH) .isfloating = 0, R_ISPERMANENT(ISPERMANENT_PATCH) R_SWALLOW(SWALLOW_PATCH) .monitor = -1 },
|
||||
|
||||
#if MONITOR_RULES_PATCH
|
||||
typedef struct {
|
||||
int monitor;
|
||||
@ -4276,8 +4303,10 @@ main(int argc, char *argv[])
|
||||
die("dwm-"VERSION);
|
||||
else if (!strcmp("-h", argv[i]) || !strcmp("--help", argv[i]))
|
||||
die(help());
|
||||
#if !PANGO_PATCH
|
||||
else if (!strcmp("-fn", argv[i])) /* font set */
|
||||
#if PANGO_PATCH
|
||||
strcpy(font, argv[++i]);
|
||||
#else
|
||||
fonts[0] = argv[++i];
|
||||
#endif // PANGO_PATCH
|
||||
#if !VTCOLORS_PATCH
|
||||
|
Reference in New Issue
Block a user