Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/freddiehaddad/swaybar
Swaybar JSON protocol generator
https://github.com/freddiehaddad/swaybar
sway swaybar swaywm
Last synced: about 1 month ago
JSON representation
Swaybar JSON protocol generator
- Host: GitHub
- URL: https://github.com/freddiehaddad/swaybar
- Owner: freddiehaddad
- License: mit
- Created: 2023-10-21T07:48:20.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-11T14:11:18.000Z (about 1 year ago)
- Last Synced: 2024-06-21T21:05:59.154Z (6 months ago)
- Topics: sway, swaybar, swaywm
- Language: Go
- Homepage:
- Size: 58.6 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Swaybar
A highly parallelized swaybar app written in Go.
List of components currently implemented included:
- Date/Time
- CPU Temperature
- CPU Utilization
- GPU Temperature
- Network Throughput## Sample Output
```text
D 977.58 Kbps U 36.79 Mbps | CPU 0.9% | CPU 26.0°C | GPU 58.0°C | Oct 23 16:14
```## How it Works
The modules (or components) are each responsible for populating the status bar
with specific data. For example, the network component provides data throughput
rates for a given interface. Similarly, the time component returns time and date
values.Each component runs in its own thread and reports updates on a specified
interval. For example, the network component can be set to publish updates every
second, millisecond, ten microseconds, etc.Whenever an update is pushed, the status bar will get updated allowing each
components report updates at different intervals.```text
+---------------+ +---------------+
| Component 0 | ... | Component N |
+-------+-------+ +-------+-------+
| |
v v
+------------------------------------------+
| Asynchronous Data Buffer |
+---------------------+--------------------+
|
v
+-------------+
| Renderer |
+------+------+
|
v
+------------------------------------------------------------------------------+
| D 97.58 Kbps U 6.79 Mbps | CPU 0.9% | CPU 26.0°C | GPU 58.0°C | Oct 23 16:14 |
+------------------------------------------------------------------------------+
```## Building
```text
go build -v -o bin ./...
```## Testing
```text
go test -v ./...
```## Installation
After building the code, copy the generated binary to a directory of your choice
and update your sway config `bar` section to launch the code. In this example,
the program is copied to `$HOME/.config/sway/statusbar`.The program will look for a `config.yml` file in a config directory in the same
location as the executable.## Configuration
Refer to the `config/config.yml` reference file for configuring the status bar.
```text
bar {
status_command $HOME/.config/sway/statusbar
}
```