From 61a33417d7a886ff404a3fc87ac601d4327e0a2f Mon Sep 17 00:00:00 2001 From: talned Date: Thu, 29 Jan 2026 07:42:38 +1100 Subject: [PATCH 1/6] script to compile and build --- bnc.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 bnc.sh diff --git a/bnc.sh b/bnc.sh new file mode 100755 index 0000000..c8e9376 --- /dev/null +++ b/bnc.sh @@ -0,0 +1,3 @@ +meson build -Dprefix=$PWD +ninja -C build + From 09382d492470d0279e4e74c7133275e34edfe427 Mon Sep 17 00:00:00 2001 From: talned Date: Thu, 29 Jan 2026 08:53:19 +1100 Subject: [PATCH 2/6] making a new horizontal tab layout --- src/layout/horizontal.h | 5 +++++ src/layout/layout.h | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/layout/horizontal.h b/src/layout/horizontal.h index e1a335d..ef3c69a 100644 --- a/src/layout/horizontal.h +++ b/src/layout/horizontal.h @@ -930,3 +930,8 @@ void tgmix(Monitor *m) { return; } } + +void tab_layout(Monitor *m) { + monocle(m) +} + diff --git a/src/layout/layout.h b/src/layout/layout.h index f896ac2..fce020e 100644 --- a/src/layout/layout.h +++ b/src/layout/layout.h @@ -12,6 +12,7 @@ static void vertical_grid(Monitor *m); static void vertical_scroller(Monitor *m); static void vertical_deck(Monitor *mon); static void tgmix(Monitor *m); +static void tab_layout(Monitor *m); /* layout(s) */ Layout overviewlayout = {"󰃇", overview, "overview"}; @@ -29,6 +30,7 @@ enum { VERTICAL_DECK, RIGHT_TILE, TGMIX, + TAB, }; Layout layouts[] = { @@ -47,4 +49,5 @@ Layout layouts[] = { {"VG", vertical_grid, "vertical_grid", VERTICAL_GRID}, // 垂直格子布局 {"VK", vertical_deck, "vertical_deck", VERTICAL_DECK}, // 垂直卡片布局 {"TG", tgmix, "tgmix", TGMIX}, // 混合布局 -}; \ No newline at end of file + {"TAB", tab_layout, "tab_layout", TAB} +}; From cbc86a21cef8420692d186d99353caa990b5d87b Mon Sep 17 00:00:00 2001 From: Talha Ahmed Date: Thu, 29 Jan 2026 08:55:11 +1100 Subject: [PATCH 3/6] Fix formatting of tab_layout entry in layout.h --- src/layout/layout.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layout/layout.h b/src/layout/layout.h index fce020e..4ff38b1 100644 --- a/src/layout/layout.h +++ b/src/layout/layout.h @@ -49,5 +49,5 @@ Layout layouts[] = { {"VG", vertical_grid, "vertical_grid", VERTICAL_GRID}, // 垂直格子布局 {"VK", vertical_deck, "vertical_deck", VERTICAL_DECK}, // 垂直卡片布局 {"TG", tgmix, "tgmix", TGMIX}, // 混合布局 - {"TAB", tab_layout, "tab_layout", TAB} + {"TAB", tab_layout, "tab_layout", TAB}, }; From d08e5fa7e33248192facbaf150fdfb23c772e6e7 Mon Sep 17 00:00:00 2001 From: talned Date: Thu, 29 Jan 2026 08:58:22 +1100 Subject: [PATCH 4/6] error needs fixing --- src/layout/horizontal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layout/horizontal.h b/src/layout/horizontal.h index ef3c69a..b356a84 100644 --- a/src/layout/horizontal.h +++ b/src/layout/horizontal.h @@ -932,6 +932,6 @@ void tgmix(Monitor *m) { } void tab_layout(Monitor *m) { - monocle(m) + monocle(m); } From 6add782b04c86f466e2c2d32219d1011115bf5b7 Mon Sep 17 00:00:00 2001 From: talned Date: Tue, 3 Feb 2026 01:42:21 +1100 Subject: [PATCH 5/6] added in variables for tabs --- src/config/parse_config.h | 43 ++++++++++++++++++++++++++++++++++++ src/config/preset.h | 44 +++++++++++++++++++++++++++++++++++++ src/dispatch/bind_declare.h | 6 ++++- 3 files changed, 92 insertions(+), 1 deletion(-) diff --git a/src/config/parse_config.h b/src/config/parse_config.h index f7ce848..ae3b8f1 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -303,6 +303,49 @@ typedef struct { float globalcolor[4]; float overlaycolor[4]; + /* TABS */ + // Tab Border Visbility + uint32_t tab_border_top; + uint32_t tab_border_bottom; + uint32_t tab_border_left; + uint32_t tab_border_right; + // Color of the tab's border when focused + float tab_focused_border_top[4]; + float tab_focused_border_bottom[4]; + float tab_focused_border_left[4]; + float tab_focused_border_right[4]; + // Color of tab's focused background (bg) and text color + float tab_focused_bg[4]; + float tab_focused_text_color[4]; + // Color of the tab's border when unfocused + float tab_unfocused_border_top[4]; + float tab_unfocused_border_bottom[4]; + float tab_unfocused_border_left[4]; + float tab_unfocused_border_right[4]; + // Color of tab's unfocused background (bg) and text color + float tab_unfocused_bg[4]; + float tab_unfocused_text_color[4]; + // Tab layout appearance + uint32_t tab_padding_width; // Space between text and left borders + uint32_t tab_padding_height; // Space between text and top/bottom borders + uint32_t tab_border_size; // Tab border thickness (pixels) + uint32_t tab_font_size; // Tab text font size (pixels) + uint32_t tab_client_border; // enable client borders (1=true, 0=false) + char tab_client_border_style[16]; // "full" (client border all sides) or "notop" (client no top border) + // Tab area appearance + uint32_t tab_area_borders; // enable borders around tab area (1=true, 0=false) + // Tab area border visibility (1=true, 0=false) + uint32_t tab_area_border_top; // top border of tab area + uint32_t tab_area_border_bottom; // bottom border of tab area + uint32_t tab_area_border_left; // left border of tab area + uint32_t tab_area_border_right; // right border of tab area + // Tab Area Border Appearance + float tab_area_border_focused[4]; // color of the tab area border when focused + float tab_area_border_unfocused[4]; // color of the tab area border when unfocused + uint32_t tab_area_border_size; // Tab border thickness (pixels) + uint32_t tab_area_padding_width; // Space between tab area border and tab's left/right borders + uint32_t tab_area_padding_height; // Space between tab area border and tab's top/bottom borders + char autostart[3][256]; ConfigTagRule *tag_rules; // 动态数组 diff --git a/src/config/preset.h b/src/config/preset.h index ae4424f..ff0a296 100644 --- a/src/config/preset.h +++ b/src/config/preset.h @@ -42,6 +42,50 @@ double default_mfact = 0.55f; // master 窗口比例 uint32_t default_nmaster = 1; // 默认master数量 int32_t center_master_overspread = 0; // 中心master时是否铺满 int32_t center_when_single_stack = 1; // 单个stack时是否居中 + +/* TABS */ +// Tab Border Visbility +uint32_t tab_border_top = 0; +uint32_t tab_border_bottom = 1; +uint32_t tab_border_left = 0; +uint32_t tab_border_right = 0; +// Color of the tab's border when focused +float tab_focused_border_top[] = COLOR(0xc9b890ff); +float tab_focused_border_bottom[] = COLOR(0xc9b890ff); +float tab_focused_border_left[] = COLOR(0xc9b890ff); +float tab_focused_border_right[] = COLOR(0xc9b890ff); +// Color of tab's focused background (bg) and text color +float tab_focused_bg[] = COLOR(0xc9b890ff); +float tab_focused_text_color[] = COLOR(0x201b14ff); +// Color of the tab's border when unfocused +float tab_unfocused_border_top[] = COLOR(0x444444ff); +float tab_unfocused_border_bottom[] = COLOR(0x444444ff); +float tab_unfocused_border_left[] = COLOR(0x444444ff); +float tab_unfocused_border_right[] = COLOR(0x444444ff); +// Color of tab's unfocused background (bg) and text color +float tab_unfocused_bg[] = COLOR(0x444444ff); +float tab_unfocused_text_color[] = COLOR(0xccccccff); +// Tab appearance +uint32_t tab_padding_width = 10; // Space between text and left borders (pixels) +uint32_t tab_padding_height = 3; // Space between text and top/bottom borders (pixel) +uint32_t tab_border_size = 2; // Tab border thickness (pixels) +uint32_t tab_font_size = 14; // Tab text font size (pixels) +uint32_t tab_client_border = 1; // enable client borders (1=true, 0=false) +char tab_client_border_style[] = "notop"; // "full" (client border all sides) or "notop" (client no top border) +// Tab area appearance +uint32_t tab_area_borders = 1; // enable borders around tab area (1=true, 0=false) +// Tab area border visibility (1=true, 0=false) +uint32_t tab_area_border_top = 1; // top border of tab area +uint32_t tab_area_border_bottom = 0; // bottom border of tab area +uint32_t tab_area_border_left = 1; // left border of tab area +uint32_t tab_area_border_right = 1; // right border of tab area +// Tab Area Border Appearance +float tab_area_border_focused[] = COLOR(0xc9b890ff); // color of the tab area border when focused +float tab_area_border_unfocused[] = COLOR(0x444444ff); // color of the tab area border when unfocused +uint32_t tab_area_border_size = 2; // Tab border thickness (pixels) +uint32_t tab_area_padding_width = 1; // Space between tab area border and tab's left/right borders +uint32_t tab_area_padding_height = 1; // Space between tab area border and tab's top/bottom borders + /* logging */ int32_t log_level = WLR_ERROR; uint32_t numlockon = 0; // 是否打开右边小键盘 diff --git a/src/dispatch/bind_declare.h b/src/dispatch/bind_declare.h index 22ef612..8b2cdc2 100644 --- a/src/dispatch/bind_declare.h +++ b/src/dispatch/bind_declare.h @@ -69,4 +69,8 @@ int32_t setoption(const Arg *arg); int32_t disable_monitor(const Arg *arg); int32_t enable_monitor(const Arg *arg); int32_t toggle_monitor(const Arg *arg); -int32_t scroller_stack(const Arg *arg); \ No newline at end of file +int32_t scroller_stack(const Arg *arg); +int32_t tab_switch_next(const Arg *arg); +int32_t tab_switch_prev(const Arg *arg); +int32_t tab_focus_first(const Arg *arg); // Switch to the first tab in the stack +int32_t tab_focus_last(const Arg *arg); // Switch to the last tab in the stack From 9f18714dc5bb58580774556e6e4ef60d8a664734 Mon Sep 17 00:00:00 2001 From: talned Date: Tue, 3 Feb 2026 02:17:20 +1100 Subject: [PATCH 6/6] added logic to tab configuration --- src/config/parse_config.h | 151 +++++++++++++++++++++++++++++++++++++- 1 file changed, 150 insertions(+), 1 deletion(-) diff --git a/src/config/parse_config.h b/src/config/parse_config.h index ae3b8f1..fb26bd1 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -304,7 +304,7 @@ typedef struct { float overlaycolor[4]; /* TABS */ - // Tab Border Visbility + // Tab Border Visbility (1 = true, 0 = false) uint32_t tab_border_top; uint32_t tab_border_bottom; uint32_t tab_border_left; @@ -1746,6 +1746,155 @@ bool parse_option(Config *config, char *key, char *value) { } else { convert_hex_to_rgba(config->overlaycolor, color); } + } else if (strcmp(key, "tab_border_top") == 0) { + config->tab_area_border_top = atoi(value); + } else if(strcmp(key, "tab_border_bottom") == 0) { + config->tab_border_bottom = atoi(value); + } else if(strcmp(key, "tab_border_left") == 0) { + config->tab_border_left = atoi(value); + } else if(strcmp(key, "tab_border_right") == 0) { + config->tab_border_right = atoi(value); + } else if (strcmp(key, "tab_focused_border_top") == 0) { + int64_t color = parse_color(value); + if (color == -1) { + fprintf(stderr, "\033[1m\033[31m[ERROR]:\033[33m Invalid tab_focused_border_top format: %s\n", value); + return false; + } else { + convert_hex_to_rgba(config->tab_focused_border_top, color); + } + } else if (strcmp(key, "tab_focused_border_bottom") == 0) { + int64_t color = parse_color(value); + if (color == -1) { + fprintf(stderr, "\033[1m\033[31m[ERROR]:\033[33m Invalid tab_focused_border_bottom format: %s\n", value); + return false; + } else { + convert_hex_to_rgba(config->tab_focused_border_bottom, color); + } + } else if (strcmp(key, "tab_focused_border_left") == 0) { + int64_t color = parse_color(value); + if (color == -1) { + fprintf(stderr, "\033[1m\033[31m[ERROR]:\033[33m Invalid tab_focused_border_left format: %s\n", value); + return false; + } else { + convert_hex_to_rgba(config->tab_focused_border_left, color); + } + } else if (strcmp(key, "tab_focused_border_right") == 0) { + int64_t color = parse_color(value); + if (color == -1) { + fprintf(stderr, "\033[1m\033[31m[ERROR]:\033[33m Invalid tab_focused_border_right format: %s\n", value); + return false; + } else { + convert_hex_to_rgba(config->tab_focused_border_right, color); + } + } else if (strcmp(key, "tab_focused_bg") == 0) { + int64_t color = parse_color(value); + if (color == -1) { + fprintf(stderr, "\033[1m\033[31m[ERROR]:\033[33m Invalid tab_focused_bg format: %s\n", value); + return false; + } else { + convert_hex_to_rgba(config->tab_focused_bg, color); + } + } else if (strcmp(key, "tab_focused_text_color") == 0) { + int64_t color = parse_color(value); + if (color == -1) { + fprintf(stderr, "\033[1m\033[31m[ERROR]:\033[33m Invalid tab_focused_text_color format: %s\n", value); + return false; + } else { + convert_hex_to_rgba(config->tab_focused_text_color, color); + } + } else if (strcmp(key, "tab_unfocused_border_top") == 0) { + int64_t color = parse_color(value); + if (color == -1) { + fprintf(stderr, "\033[1m\033[31m[ERROR]:\033[33m Invalid tab_unfocused_border_top format: %s\n", value); + return false; + } else { + convert_hex_to_rgba(config->tab_unfocused_border_top, color); + } + } else if (strcmp(key, "tab_unfocused_border_bottom") == 0) { + int64_t color = parse_color(value); + if (color == -1) { + fprintf(stderr, "\033[1m\033[31m[ERROR]:\033[33m Invalid tab_unfocused_border_bottom format: %s\n", value); + return false; + } else { + convert_hex_to_rgba(config->tab_unfocused_border_bottom, color); + } + } else if (strcmp(key, "tab_unfocused_border_left") == 0) { + int64_t color = parse_color(value); + if (color == -1) { + fprintf(stderr, "\033[1m\033[31m[ERROR]:\033[33m Invalid tab_unfocused_border_left format: %s\n", value); + return false; + } else { + convert_hex_to_rgba(config->tab_unfocused_border_left, color); + } + } else if (strcmp(key, "tab_unfocused_border_right") == 0) { + int64_t color = parse_color(value); + if (color == -1) { + fprintf(stderr, "\033[1m\033[31m[ERROR]:\033[33m Invalid tab_unfocused_border_right format: %s\n", value); + return false; + } else { + convert_hex_to_rgba(config->tab_unfocused_border_right, color); + } + } else if (strcmp(key, "tab_unfocused_bg") == 0) { + int64_t color = parse_color(value); + if (color == -1) { + fprintf(stderr, "\033[1m\033[31m[ERROR]:\033[33m Invalid tab_unfocused_bg format: %s\n", value); + return false; + } else { + convert_hex_to_rgba(config->tab_unfocused_bg, color); + } + } else if (strcmp(key, "tab_unfocused_text_color") == 0) { + int64_t color = parse_color(value); + if (color == -1) { + fprintf(stderr, "\033[1m\033[31m[ERROR]:\033[33m Invalid tab_unfocused_text_color format: %s\n", value); + return false; + } else { + convert_hex_to_rgba(config->tab_unfocused_text_color, color); + } + } else if (strcmp(key, "tab_padding_width") == 0) { + config->tab_padding_width = atoi(value); + } else if (strcmp(key, "tab_padding_height") == 0) { + config->tab_padding_height = atoi(value); + } else if (strcmp(key, "tab_border_size") == 0) { + config->tab_border_size = atoi(value); + } else if (strcmp(key, "tab_font_size") == 0) { + config->tab_font_size = atoi(value); + } else if (strcmp(key, "tab_client_border") == 0) { + config->tab_client_border = atoi(value); + } else if (strcmp(key, "tab_client_border_style") == 0) { + strncpy(config->tab_client_border_style, value, sizeof(config->tab_client_border_style) - 1); + config->tab_client_border_style[sizeof(config->tab_client_border_style) - 1] = '\0'; + } else if (strcmp(key, "tab_area_borders") == 0) { + config->tab_area_borders = atoi(value); + } else if (strcmp(key, "tab_area_border_top") == 0) { + config->tab_area_border_top = atoi(value); + } else if (strcmp(key, "tab_area_border_bottom") == 0) { + config->tab_area_border_bottom = atoi(value); + } else if (strcmp(key, "tab_area_border_left") == 0) { + config->tab_area_border_left = atoi(value); + } else if (strcmp(key, "tab_area_border_right") == 0) { + config->tab_area_border_right = atoi(value); + } else if (strcmp(key, "tab_area_border_focused") == 0) { + int64_t color = parse_color(value); + if (color == -1) { + fprintf(stderr, "\033[1m\033[31m[ERROR]:\033[33m Invalid tab_area_border_focused format: %s\n", value); + return false; + } else { + convert_hex_to_rgba(config->tab_area_border_focused, color); + } + } else if (strcmp(key, "tab_area_border_unfocused") == 0) { + int64_t color = parse_color(value); + if (color == -1) { + fprintf(stderr, "\033[1m\033[31m[ERROR]:\033[33m Invalid tab_area_border_unfocused format: %s\n", value); + return false; + } else { + convert_hex_to_rgba(config->tab_area_border_unfocused, color); + } + } else if (strcmp(key, "tab_area_border_size") == 0) { + config->tab_area_border_size = atoi(value); + } else if (strcmp(key, "tab_area_padding_width") == 0) { + config->tab_area_padding_width = atoi(value); + } else if (strcmp(key, "tab_area_padding_height") == 0) { + config->tab_area_padding_height = atoi(value); } else if (strcmp(key, "monitorrule") == 0) { config->monitor_rules = realloc(config->monitor_rules, (config->monitor_rules_count + 1) *