From 318a85714ae9f4aded6b95a14c4802918489b5fd Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 6 May 2026 12:35:25 -0700 Subject: glide: Add current mode to the tab bar --- glide/.config/glide/tabbar.glide.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/glide/.config/glide/tabbar.glide.ts b/glide/.config/glide/tabbar.glide.ts index 3ad7817..dd4cf27 100644 --- a/glide/.config/glide/tabbar.glide.ts +++ b/glide/.config/glide/tabbar.glide.ts @@ -122,6 +122,8 @@ async function update_status_bar() { return } + const mode = glide.ctx.mode; + try { const current_window = await browser.windows.getCurrent(); const tabs = await browser.tabs.query({ @@ -138,7 +140,7 @@ async function update_status_bar() { display_url = display_url.substring(0, 47) + "..."; } - tabs_container.textContent = `[${tab_index + 1}/${tabs.length}]`; + tabs_container.textContent = `${mode} [${tab_index + 1}/${tabs.length}]`; right.textContent = `${title} | ${display_url}`; } catch (e) { tabs_container.textContent = e; @@ -146,7 +148,7 @@ async function update_status_bar() { } } -glide.autocmds.create("ModeChanged", "*", (args) => { +glide.autocmds.create("ModeChanged", "*", async (args) => { const style_id = "glide-custom-mode-indicator" glide.styles.remove(style_id) glide.styles.add(` @@ -154,6 +156,7 @@ glide.autocmds.create("ModeChanged", "*", (args) => { border-bottom: 3px solid var(${mode_colors[args.new_mode] ?? fallback_mode_color}) } `, { id: style_id }) + await update_status_bar(); }) glide.autocmds.create("UrlEnter", /.*/, async () => { -- cgit v1.3-2-g0d8e