swaybar_info/README.md

37 lines
1.3 KiB
Markdown
Raw Normal View History

2022-07-09 10:06:51 +00:00
# swaybar\_info
2022-07-09 10:14:53 +00:00
## About
swaybar\_info is a program to be utilized by swaybar that is used by the [Sway
2022-07-10 07:53:34 +00:00
tiling Wayland compositor](https://swaywm.org).
2022-07-09 10:14:53 +00:00
2022-07-09 10:06:51 +00:00
## Usage
# build the "release" build of the program
cargo build --release
# put the "release" build somewhere to be used by swaybar
cp ./target/release/swaybar_info ~/.config/sway/
Put the following in your `~/.config/sway/config`:
bar {
position top
# Set --netdev=<device> such that <device> is the network device you
# want to monitor. You can omit --netdev=<device>, but that will also
# cause the program to omit network traffic stats.
status_command $HOME/.config/sway/swaybar_info --netdev=enp7s0
# One can use the "--regex-cmd=<cmd>[SPLIT]<args...>[SPLIT]<regex>" option like so:
status_command $HOME/.config/sway/swaybar_info --regex-cmd="acpi[SPLIT]-b[SPLIT][0-9]+%.*"
# This example gets battery info into the bar.
2022-07-12 08:55:18 +00:00
# Multiple args should be separated with "[SPLIT]".
2022-07-12 08:41:41 +00:00
# Note that the <args...> portion is optional.
2022-07-09 10:06:51 +00:00
}
## Dependencies
Uses [`serde_json`](https://crates.io/crates/serde_json),
[`serde`](https://crates.io/crates/serde),
[`chrono`](https://crates.io/crates/chrono),
and [`regex`](https://crates.io/crates/regex).