Go to file
Stephen Seo 9305a968a8 Impl "--regex-cmd=<cmd>,<args...>,<regex>"
The "--regex-cmd=..." allows executing processes and fetching regex'd strings
from its stdout to use on swaybar.
2022-07-12 17:30:15 +09:00
src Impl "--regex-cmd=<cmd>,<args...>,<regex>" 2022-07-12 17:30:15 +09:00
.gitignore Init skeleton project 2022-07-09 15:44:04 +09:00
Cargo.lock Impl "--regex-cmd=<cmd>,<args...>,<regex>" 2022-07-12 17:30:15 +09:00
Cargo.toml Impl "--regex-cmd=<cmd>,<args...>,<regex>" 2022-07-12 17:30:15 +09:00
LICENSE Add MIT LICENSE 2022-07-09 19:01:23 +09:00
README.md Impl "--regex-cmd=<cmd>,<args...>,<regex>" 2022-07-12 17:30:15 +09:00

swaybar_info

About

swaybar_info is a program to be utilized by swaybar that is used by the Sway tiling Wayland compositor.

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>,<args...>,<regex>" option like so:
    status_command $HOME/.config/sway/swaybar_info --regex-cmd="acpi,-b,[0-9]+%.*"
    # This example gets battery info into the bar.
}

Dependencies

Uses serde_json, serde, chrono, and regex.