| Crates.io | dwm-statusbar |
| lib.rs | dwm-statusbar |
| version | 0.1.1 |
| created_at | 2025-01-28 03:45:06.703879+00 |
| updated_at | 2025-01-28 03:45:06.703879+00 |
| description | Simple and fast modular status bar for dwm written in rust. |
| homepage | |
| repository | https://github.com/thatmagicalcat/dwm-statusbar |
| max_upload_size | |
| id | 1533230 |
| size | 44,091 |
dwm-statusbar is a customizable status bar for the dwm window manager, written in Rust.
The status bar is configured in the main.rs file. You can define different blocks and their update intervals using the blocks! macro. For example:
use dwm_statusbar::*;
StatusBar::new(
" | ", // separator
vec![
// blocks! {
// { function, update interval in ms },
// }
// window 1
blocks! {
{ |_num_updates| "window 1".to_string(), 1_000 },
},
// window 2
blocks! {
{ |_num_updates| "window 2".to_string(), 1_000 },
},
],
)
Check src/main.rs for a template on how to use this for your own status bar.
The windowing feature allows you to switch between different sets of status blocks. This can be useful if you want to display different information based on the context.
To switch windows, you can send the desired window index to the Unix socket located at /tmp/dwm-statusbar.sock. For example, to switch to window 1:
$ echo "1" | nc -U /tmp/dwm-statusbar.sock
To run the status bar, simply build and execute your Rust project:
$ cargo build --release
$ ./target/release/dwm-statusbar
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.