修改规则格式

This commit is contained in:
2025-08-23 02:28:02 +08:00
parent 2e75dbf75e
commit bd052edffe
3 changed files with 83 additions and 42 deletions

View File

@@ -1,6 +1,7 @@
#pragma once
#include <X11/keysym.h>
#include <stdbool.h>
#include <stdint.h>
#include <xcb/xproto.h>
@@ -51,21 +52,31 @@ const layout_t layouts[] = {
{"><>", NULL},
};
/* 新建窗口规则,以 NULL 结束 */
/* 默认 tags 规则 */
const rule_tag_t browser_tag[] = {
{.monitor_amount = 1, .tags = 1 << 1},
{0},
};
const rule_tag_t mpv_tag[] = {
{.monitor_amount = 1, .monitor_index = 0, .tags = 1 << 3},
{.monitor_amount = 2, .monitor_index = 1, .tags = 1 << 2},
{0},
};
const rule_tag_t emacs_tag[] = {
{.monitor_amount = 1, .monitor_index = 0, .tags = 1 << 2},
{.monitor_amount = 2, .monitor_index = 0, .tags = 1 << 1},
{0},
};
/* 新建窗口规则 */
const rule_t rules[] = {
/* client 固定规则 */
{.class = "firefox", .maximize = true},
{.class = "Google-chrome", .maximize = true},
{.class = "mpv", .fullscreen = true},
{.class = "Emacs", .switch_to_tag = true, .maximize = true},
/* client 默认 tag 规则 */
{.class = "firefox", .monitor_index = 0, .tags = 1 << 1},
{.class = "Google-chrome", .monitor_index = 0, .tags = 1 << 1},
{.class = "mpv", .monitor_amount = 1, .monitor_index = 0, .tags = 1 << 3},
{.class = "mpv", .monitor_amount = 2, .monitor_index = 1, .tags = 1 << 2},
{.class = "Emacs", .monitor_amount = 1, .monitor_index = 0, .tags = 1 << 2},
{.class = "Emacs", .monitor_amount = 2, .monitor_index = 0, .tags = 1 << 1},
{.class = "firefox", .action = {.maximize = true}, .tag = browser_tag},
{.class = "Google-chrome", .action = {.maximize = true}, .tag = browser_tag},
{.class = "mpv", .action = {.fullscreen = true}, .tag = mpv_tag},
{
.class = "Emacs",
.action = {.switch_to_tag = true, .maximize = true},
.tag = emacs_tag,
},
};
#define SUPER XCB_MOD_MASK_4