MCPcopy Index your code
hub / github.com/MaxVerevkin/i3bar-river

github.com/MaxVerevkin/i3bar-river @v1.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.1.0 ↗ · + Follow
190 symbols 315 edges 21 files 6 documented · 3%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

i3bar-river

This is a port of i3bar for wlroots-based window managers. Tags/workspaces are implemented for river, hyprland and niri.

i3bar compatibility

I've tested i3status-rs, bumblebee-status and py3status and everything seems usable.

A list of things that are missing (for now): - border[_top|_right|_bottom|_left] - Click events lack some info (IDK if anyone actually relies on x, y, width, etc.) - Tray icons

Features

  • river support (obviously)
  • short_text switching is "progressive" (see https://github.com/i3/i3/issues/4113)
  • Support for rounded corners
  • Show/hide with pkill -SIGUSR1 i3bar-river

Installation

Packaging status

From Source

External dependencies: libpango1.0-dev.

cargo install --locked i3bar-river

Configuration

Add this to the end of your river init script:

riverctl spawn i3bar-river

The configuration file should be stored in $XDG_CONFIG_HOME/i3bar-river/config.toml or ~/.config/i3bar-river/config.toml.

The default configuration (every parameter is optional):

# The status generator command.
# Optional: with no status generator the bar will display only tags and layout name.
# command = "your command here"

# Colors
background = "#282828ff"
color = "#ffffffff"
separator = "#9a8a62ff"
tag_fg = "#d79921ff"
tag_bg = "#282828ff"
tag_focused_fg = "#1d2021ff"
tag_focused_bg = "#689d68ff"
tag_urgent_fg = "#282828ff"
tag_urgent_bg = "#cc241dff"
tag_inactive_fg = "#d79921ff"
tag_inactive_bg = "#282828ff"

# The font and various sizes
font = "monospace 10"
height = 24
margin_top = 0
margin_bottom = 0
margin_left = 0
margin_right = 0
separator_width = 2.0
tags_r = 0.0
tags_padding = 25.0
tags_margin = 0.0
blocks_r = 0.0
blocks_overlap = 0.0

# Misc
position = "top" # either "top" or "bottom"
layer = "top" # one of "top", "overlay", "bottom" or "background"
hide_inactive_tags = true
invert_touchpad_scrolling = true
show_tags = true
show_layout_name = true
blend = true # whether tags/blocks colors should blend with bar's background
show_mode = true

# WM-specific options
[wm.river]
max_tag = 9 # Show only the first nine tags

# Per output overrides
# [output.your-output-name]
# right now only "enable" option is available
# enable = false
#
# You can have any number of overrides
# [output.eDP-1]
# enable = false

How progressive short mode and rounded corners work

Some status bar generators (such as i3status-rs) use more than one "json block" per logical block to implement, for example, buttons.

Short text management and corner rounding are performed on per-logical-block basis.

i3bar-river defines a logical block as a continuous series of "json blocks" with the same name. Also, only the last "json block" is allowed to have a non zero (or absent) separator_block_width, all the other "json blocks" should explicitly set it to zero. If you think this definition is not the best one, feel free to open a new github issue.

blocks_overlap option

Sometimes pango lives a gap between "powerline separators" and the blocks (see https://github.com/greshake/i3status-rust/issues/246#issuecomment-1086753440). In this case, you can set blocks_overlap option to number of pixels you want your blocks to overlap. Usually, 1 is a good choice.

Showcase (with i3status-rs)

Native separators

Native separators demo

i3bar-river

font = "JetBrainsMono Nerd Font 10"
height = 20
command = "i3status-rs"

i3status-rs

[theme]
theme = "native"
[theme.overrides]
idle_fg = "#ebdbb2"
info_fg = "#458588"
good_fg = "#8ec07c"
warning_fg = "#fabd2f"
critical_fg = "#fb4934"

Powerline separators

Powerline separators demo

i3bar-river

font = "JetBrainsMono Nerd Font 10"
height = 20
command = "i3status-rs"

i3status-rs

[theme]
theme = "slick"

Rounded corners

Rounded corners demo

i3bar-river

font = "JetBrainsMono Nerd Font 10"
height = 20
separator_width = 0
tags_r = 6
blocks_r = 6
command = "i3status-rs"

i3status-rs

[theme]
theme = "slick"
[theme.overrides]
separator = "native"
alternating_tint_bg = "none"
alternating_tint_fg = "none"

Extension points exported contracts — how you extend this code

WmInfoProvider (Interface)
(no doc) [4 implementers]
src/wm_info_provider.rs

Core symbols most depended-on inside this repo

push
called by 17
src/button_manager.rs
clear
called by 6
src/button_manager.rs
frame
called by 6
src/bar.rs
bind
called by 5
src/wm_info_provider.rs
set_error
called by 5
src/state.rs
tags_updated
called by 5
src/state.rs
register_with_fd
called by 5
src/event_loop.rs
render
called by 4
src/text.rs

Shape

Method 109
Class 42
Function 30
Enum 8
Interface 1

Languages

Rust100%

Modules by API surface

src/state.rs21 symbols
src/config.rs18 symbols
src/i3bar_protocol.rs17 symbols
src/bar.rs16 symbols
src/wm_info_provider/river.rs15 symbols
src/wm_info_provider/hyprland.rs14 symbols
src/wm_info_provider/niri.rs13 symbols
src/wm_info_provider.rs10 symbols
src/color.rs9 symbols
src/blocks_cache.rs9 symbols
src/text.rs8 symbols
src/event_loop.rs7 symbols

For agents

$ claude mcp add i3bar-river \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page