Easy, Simple, Clean. Making status bars reliable and up-to-date. This project was inspired by dwmblocks but is a Rust alternative with a toml configuration file.
Compiling simple_status
yourself doesn't require much.
All dependencies are likely readily available in your repository.
- Cargo
- libX11
- git
- Run
./install.sh
- Optional - Move default config to the simple_status config directory:
mkdir -p ~/.config/simple_status && cp config.toml ~/.config/simple_status
The default configuration can be found at ~/config.toml
. The config file must satisfy a seperator
. The seperator
is the string injected between the module outputs, you could think of it as the spacer, or hence the name, a seperator.
Modules can either define a command to be executed and you use the output as return value from the module or configure a built-in module. If no built_in
or command
the module will not display. The order in which modules are defined down the config file will map left to right on the bar. For example the first module defined will become the left-most module on the status bar and the last will become the righ-most.
update
Should the module update.delay
The delay in milliseconds between updates.
cpu
CPU usage as a percentage.mem
Memory usage as a percentage.uptime
Uptime in the formathours:mins:seconds
date
Date in the formatday month year
time
Time inhours:mins:seconds
load
Load as an average of the past minuteload_all
Load average in the formatone five fifteen
seperator = "|"
[[module]]
prefix = "Time: "
built_in = "time"
To create a command module all that needs to be defined is a module with a command. A built_in
should be defined, however the result would likely not result in an error and would be ignored.
seperator = "|"
[[module]]
prefix = "Kernel: "
command = "uname -r"
All simple_status is doing effectivley is xsetroot -name <output>
with the output being the infomation generated from the config file.
In ~/src/status.rs
simple_status has to do some calling of the X11 C API xlib. Due to Rust not being able to know if this could could be safe or unsafe all calls to see functions must be wrapped with an unsafe
scope. For the most part this should be completely safe. X11 has been out for a long time now (you could see this as a negative or a positive) and any issues have likely been ironed out.
Using xlib does how ever mean at compile-time it must be linked to the X11 library, this can be seen in ~/build.rs
and is why libX11
is required.