niri-workspaces-rs

a better way to visualise workspace windows in niri window manager
Log | Files | Refs | README

commit 06240ac1f6b302f67c3c451dc5cba3db9a6fb659
parent 60571fbceda11191d058a7a61aae103e776abd0e
Author: ryukamish <[email protected]>
Date:   Sat, 11 Apr 2026 23:58:52 +0530

add: workspace number on the left of the indicator

Diffstat:
Msrc/main.rs | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/main.rs b/src/main.rs @@ -134,10 +134,16 @@ fn output_status(workspaces: &[Workspace], windows: &[Window]) { let ws_output = if win_count == 0 { // Empty but focused - just show a dot, no name - "<span color='#888888'>·</span>".to_string() + // "<span color='#888888'>·</span>".to_string() + format!("{} <span color='#888888'>.</span>", ws.idx) } else { let mut output = String::new(); + // Always show the workspace number on the left + if ws.is_focused { + output.push_str(&format!("{} ", ws.idx)); + } + // Show workspace name only when focused if has_custom_name && ws.is_focused { output.push_str(&format!("<span color='#cccccc'>{}</span> ", ws_name)); @@ -154,7 +160,7 @@ fn output_status(workspaces: &[Workspace], windows: &[Window]) { } let mut bar = if win.is_focused { - "█" + "<span color='#ffa500'>█</span>" } else if !ws.is_focused && ws.active_window_id == Some(win.id) { "▌" } else { @@ -166,6 +172,7 @@ fn output_status(workspaces: &[Workspace], windows: &[Window]) { bar = "¦"; } + // output.push_str(&format!("<span color='{}'>{}</span>", color, bar)); output.push_str(&format!("<span color='{}'>{}</span>", color, bar)); } output