Convert Figma logo to code with AI

greshake logoi3status-rust

Very resourcefriendly and feature-rich replacement for i3status, written in pure Rust

2,865
472
2,865
102

Top Related Projects

14,136

A fast and easy-to-use status bar

7,224

Light-weight system monitor for X, Wayland (sort of), and other things, too

The hacker-friendly status_command for Sway and i3

9,115

ElKowars wacky widgets

Quick Overview

i3status-rust is a feature-rich and resource-efficient replacement for i3status, written in Rust. It is designed to generate a status line for i3bar, swaybar, or other compatible bars, providing system information and customizable widgets.

Pros

  • Highly customizable with a wide range of built-in blocks
  • Written in Rust, offering better performance and memory safety compared to the original i3status
  • Supports themes and icons for improved visual appearance
  • Active development and community support

Cons

  • Steeper learning curve compared to the original i3status
  • Requires Rust knowledge for advanced customization or contributing
  • May have higher resource usage than the original i3status for complex configurations
  • Limited documentation for some advanced features

Getting Started

  1. Install Rust and Cargo (Rust's package manager)
  2. Clone the repository:
    git clone https://github.com/greshake/i3status-rust.git
    
  3. Build and install:
    cd i3status-rust
    cargo install --path .
    
  4. Create a configuration file:
    mkdir -p ~/.config/i3status-rust
    cp examples/config.toml ~/.config/i3status-rust/config.toml
    
  5. Edit your i3 or sway config to use i3status-rust:
    bar {
        status_command i3status-rs ~/.config/i3status-rust/config.toml
    }
    
  6. Restart i3 or sway to apply changes

Competitor Comparisons

14,136

A fast and easy-to-use status bar

Pros of polybar

  • More customizable and feature-rich, with a wide range of built-in modules
  • Supports multiple bars and advanced theming options
  • Has a larger community and more extensive documentation

Cons of polybar

  • Written in C++, which may be less accessible for some users to customize
  • Can be more resource-intensive, especially with complex configurations
  • Steeper learning curve due to its extensive configuration options

Code comparison

i3status-rust configuration:

[[block]]
block = "cpu"
interval = 1
format = "{utilization}% {frequency}GHz"

polybar configuration:

[module/cpu]
type = internal/cpu
interval = 1
format = <label> <ramp-coreload>
label = CPU %percentage%%

Additional notes

i3status-rust is specifically designed for i3 window manager, while polybar is more versatile and can be used with various window managers. i3status-rust is written in Rust, which may offer better performance for simpler configurations. Polybar provides more advanced features like clickable modules and graphical elements, but i3status-rust focuses on simplicity and efficiency.

7,224

Light-weight system monitor for X, Wayland (sort of), and other things, too

Pros of Conky

  • Highly customizable with extensive theming options
  • Supports a wide range of system monitoring features
  • Can be used as a standalone desktop widget

Cons of Conky

  • Steeper learning curve due to its configuration complexity
  • May consume more system resources compared to lighter alternatives
  • Less integrated with specific window managers like i3

Code Comparison

Conky configuration (Lua):

conky.config = {
    alignment = 'top_right',
    background = false,
    border_width = 1,
    cpu_avg_samples = 2,
    default_color = 'white',
    double_buffer = true,
}

i3status-rust configuration (TOML):

[theme]
name = "solarized-dark"
[icons]
name = "awesome"

[[block]]
block = "cpu"
interval = 1

While both projects aim to provide system information, Conky offers a more versatile and standalone approach, suitable for various desktop environments. i3status-rust, on the other hand, is specifically designed for use with the i3 window manager, providing a more streamlined and integrated experience for i3 users. Conky's configuration uses Lua, allowing for complex customizations, while i3status-rust uses TOML for a simpler, more structured configuration format.

The hacker-friendly status_command for Sway and i3

Pros of i3blocks

  • Written in C, potentially offering better performance
  • Simpler configuration with a straightforward INI-style format
  • Supports a wide range of built-in blocks out of the box

Cons of i3blocks

  • Less actively maintained compared to i3status-rust
  • Limited customization options without writing custom scripts
  • Lacks some advanced features like async updates and click handlers

Code Comparison

i3blocks configuration:

[time]
command=date '+%Y-%m-%d %H:%M:%S'
interval=1

[battery]
command=acpi -b | awk '{print $4}'
interval=10

i3status-rust configuration:

[[block]]
block = "time"
interval = 1
format = "%Y-%m-%d %H:%M:%S"

[[block]]
block = "battery"
interval = 10
format = "{percentage}%"

Both projects aim to provide status bar information for i3 window manager. i3blocks offers simplicity and performance, while i3status-rust provides more features and customization options. i3status-rust is written in Rust, offering memory safety and modern language features. It also has a more active development community. The choice between the two depends on specific needs, with i3blocks being suitable for basic setups and i3status-rust for more advanced configurations.

9,115

ElKowars wacky widgets

Pros of eww

  • More flexible and customizable, allowing for complex widgets and layouts
  • Supports multiple window managers and desktop environments
  • Uses Yuck, a declarative language, for easier configuration

Cons of eww

  • Steeper learning curve due to its more complex configuration system
  • Potentially higher resource usage for elaborate setups
  • Less focused on status bar functionality compared to i3status-rust

Code Comparison

i3status-rust configuration example:

[[block]]
block = "cpu"
interval = 1
format = "{utilization}% {frequency}GHz"

eww configuration example:

(defwidget cpu []
  (box :class "cpu"
       :orientation "h"
       :space-evenly false
    (label :text "${round(EWW_CPU.avg, 0)}%")
    (label :text "${round(EWW_CPU.freq / 1000000, 1)}GHz")))

Summary

i3status-rust is a more straightforward, lightweight status bar for i3 and similar window managers. It's easier to set up but less flexible. eww, on the other hand, offers greater customization and works across various environments, but requires more effort to configure and may consume more resources.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

i3status-rust

demo1

i3status-rs is a feature-rich and resource-friendly replacement for i3status, written in pure Rust. It provides a way to display "blocks" of system information (time, battery status, volume, etc) on bars that support the i3bar protocol.

Getting Started

Install from one of the packages below:

Packaging status

  • For Fedora/CentOS, you can install from the COPR.

  • For NixOS, you can also use Home Manager: programs.i3status-rust.enable = true see available options

  • NOTE: Installation via cargo is not supported.

Otherwise refer to manual install docs.

Configuration

After installing i3status-rust, edit the example configuration to your liking. The default location is $XDG_CONFIG_HOME/i3status-rust/config.toml.

There are some optional global configuration variables, defined either at the top-level or in a TOML table.

[icons] table:

KeyDescriptionDefault
iconsThe icon set that should be used."none"
[icons.icons_overrides]Refer to Themes and Icons below.None

[theme] table:

KeyDescriptionDefault
themeThe theme that should be used."plain"
[theme.theme_overrides]Refer to Themes and Icons below.None

Global variables:

KeyDescriptionDefault
icons_formatA string to customise the appearance of each icon. Can be used to edit icons' spacing or specify a font that will be applied only to icons via pango markup. For example, " <span font_family='NotoSans Nerd Font'>{icon}</span> "." {icon} "
invert_scrollingWhether to invert the direction of scrolling, useful for touchpad users.false
error_formatA string to customise how block errors are displayed. See below for available placeholders."$short_error_message|X"
error_fullscreen_formatA string to customise how block errors are displayed when clicked. See below for available placeholders."$full_error_message"

Available error_format and error_fullscreen_format placeholders:

PlaceholderValue
full_error_messageThe full error message
short_error_messageThe short error message, if available

Further documentation

Latest release

Master

Integrate it into i3/sway

Next, edit your bar configuration to use i3status-rust. For example:

bar {
    font pango:DejaVu Sans Mono, FontAwesome 12
    position top
    status_command path/to/i3status-rs path/to/your/config.toml
    colors {
        separator #666666
        background #222222
        statusline #dddddd
        focused_workspace #0088CC #0088CC #ffffff
        active_workspace #333333 #333333 #ffffff
        inactive_workspace #333333 #333333 #888888
        urgent_workspace #2f343a #900000 #ffffff
    }
}

In order to use the built-in support for the Font Awesome icon set, you will need to include it in the font parameter, as above. Check to make sure that "FontAwesome" will correctly identify the font by using fc-match, e.g.

$ fc-match FontAwesome
fontawesome-webfont.ttf: "FontAwesome" "Regular"

Note that the name of the Font Awesome font may have changed in version 5 or above.
You can use fc-list to see the names of your available Awesome Fonts.

$ fc-list | grep -i awesome
/usr/share/fonts/TTF/fa-solid-900.ttf: Font Awesome 5 Free,Font Awesome 5 Free Solid:style=Solid
/usr/share/fonts/TTF/fa-regular-400.ttf: Font Awesome 5 Free,Font Awesome 5 Free Regular:style=Regular

In this example, you have to use Font Awesome 5 Free instead of the FontAwesome 12 in the example configuration above. You can verify the name again using fc-match

See #130 for further discussion.

Finally, reload i3: i3 reload.

Behavior

Each block has a State that defines its colors: one of "Idle", "Info", "Good", "Warning", "Critical" or "Error". The state is determined by the logic in each block, for example, the Music block state is "Info" when there is an active player.

When the state is "Error", a short error will be displayed in the block. The full message can be toggled by clicking on the block (overrides any click actions defined in the config). The block will be restarted after error_interval has elapsed.

i3bar has a "power savings" feature that pauses the bar via SIGSTOP when it is hidden or obscured by a fullscreen container. If this causes issues with your bar, try running i3status-rs with the --never-stop argument, which changes the signal sent by i3 from SIGSTOP to SIGCONT.

In addition to the per-block signal config option, i3status-rs can be signalled to force an update of all blocks by sending it the SIGUSR1 signal. It can also be restarted in place (useful for testing changes to the config file) by sending it the SIGUSR2 signal.

Debugging

Run i3status-rust in a terminal to check the JSON it is outputting.
In addition, some blocks have debug logs that can be enabled like so: RUST_LOG=block=debug i3status-rs where "block" is the block name.

Contributing

We welcome new contributors! Take a gander at CONTRIBUTING.md.

License

This project is licensed under the GPLv3. See the LICENSE file for details.