https://github.com/hejsil/delay-line
Delays lines comming from stdin
https://github.com/hejsil/delay-line
cli command-line-tool zig
Last synced: 3 months ago
JSON representation
Delays lines comming from stdin
- Host: GitHub
- URL: https://github.com/hejsil/delay-line
- Owner: Hejsil
- License: mit
- Archived: true
- Created: 2020-10-14T16:42:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-02T06:57:32.000Z (over 2 years ago)
- Last Synced: 2025-01-26T19:27:18.582Z (over 1 year ago)
- Topics: cli, command-line-tool, zig
- Language: Zig
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# delay-line
A command line tool that prints all lines from stdin to stdout with
a fixed delay between each line.
## Examples
Print the date+time every second:
```sh
# Notice, this pipeline only ever launches 5 processes. It is also a
# a lot cleaner than the alternative "run date every second in a loop".
# Clean and efficient!
seq "$(date +%s)" 1 inf | sed 's/^/@/' | date -f - | delay-line 1s
# You can get more efficient by raising the delay.
seq "$(date +%s)" 10 inf | sed 's/^/@/' | date -f - | delay-line 10s
# This is useful for making your own status bar script for bars
# such as lemonbar.
```
## Build
External dependencies:
* [Zig `0.6.0`](https://ziglang.org/download/)
After getting the dependencies just clone the repo and its submodules and run:
```
zig build
```
All build artifacts will end up in `zig-cache/bin`.
See `zig build --help` for build options.