https://github.com/lig/status-slayer
Status Slayer is a configurable implementation of status command for Sway WM using Swaybar Protocol.
https://github.com/lig/status-slayer
config rust statusbar sway swaywm toml
Last synced: 8 months ago
JSON representation
Status Slayer is a configurable implementation of status command for Sway WM using Swaybar Protocol.
- Host: GitHub
- URL: https://github.com/lig/status-slayer
- Owner: lig
- License: mit
- Created: 2024-12-27T08:56:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-05T11:50:04.000Z (over 1 year ago)
- Last Synced: 2025-02-23T08:12:11.592Z (over 1 year ago)
- Topics: config, rust, statusbar, sway, swaywm, toml
- Language: Rust
- Homepage: https://codeberg.org/lig/status-slayer
- Size: 61.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Status Slayer
Status Slayer is a configurable implementation of the `status` command for [Sway WM](https://swaywm.org/) using the Swaybar Protocol. Written in Rust, it provides a fast and highly customizable way to display status information in your Swaybar.
## Features
- **Flexible Configuration**: Configure commands and intervals using a simple [TOML](https://toml.io/) format.
- **Efficient Updates**: Sends updates to Swaybar only when a command's output changes, ensuring minimal latency.
- **Custom Intervals**: Supports interval-based commands or one-shot execution for static values.
### Planned Features
- Configurable click actions for sections.
- Color configuration per section.
- Pango markup support for rich text formatting.
- Built-in modules (e.g., `hostname`, `date`, `memory`, `cpu`, `network`) that eliminate the need for external commands.
## Installation
Install using Cargo:
```bash
cargo install --locked stlayer
```
## Usage
Add the following to your Sway configuration file (`~/.config/sway/config`):
```bash
status_command stslayer [--config ]
```
Replace `` with the path to your configuration file. Default config path is `$XDG_CONFIG_HOME/stslayer/config.toml`.
### Configuration
Status Slayer uses a TOML-based configuration file. Below is an example:
```toml
min_interval = 0.1
[[section]]
name = "kernel name"
command = "uname -s"
interval = "oneshot"
[[section]]
name = "date and time"
command = 'date "+%Y-%m-%d %H:%M:%S"'
```
### Configuration Options
- **`min_interval`**: Minimal global status update interval in seconds. Updates won't be sent to Sway more often than that (default: `0.1`).
- **`name`**: A label for the section.
- **`command`**: The shell command to execute for the section.
- **`interval`**: The interval in seconds to execute the command (default: `1`). Use "oneshot" for commands that run only once.
> Minimum value for all intervals is `0.1`.
### How It Works
- Each command runs at the defined interval, and the last known output is displayed in the status bar.
- Status Slayer sends updates to Swaybar immediately whenever a command's output changes.
## Contributing
Contributions are welcome! If you find a bug, have a feature request, or want to contribute code, feel free to:
- Open an issue: [https://codeberg.org/lig/status-slayer/issues](https://codeberg.org/lig/status-slayer/issues)
- Fork the repository and submit a pull request.
## License
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
## Links
- **Repository**: [https://codeberg.org/lig/status-slayer](https://codeberg.org/lig/status-slayer)
- **Issues**: [https://codeberg.org/lig/status-slayer/issues](https://codeberg.org/lig/status-slayer/issues)