Crates.io | trigout |
lib.rs | trigout |
version | 0.1.0 |
source | src |
created_at | 2021-03-23 14:22:34.19908 |
updated_at | 2021-03-23 14:22:34.19908 |
description | Trigger based formatter |
homepage | |
repository | https://github.com/DevHyperCoder/trigout |
max_upload_size | |
id | 372590 |
size | 52,050 |
trigout
ships with two binaries, trigout
and trigin
.
trigout <socket name> <file name>
NOTE: for usage of filename, socket name MUST be provided.
Default socket name is 0
.
If filename is provided, stdout will also be copied over to the file, overwriting it.
Config file: ~/.config/trigout.json
Each new socket address requires configuration in the json file
json [ { "sock_name": "a", // Socket name to connect "format_str": "Hi! Date is {date}. Time is {h}:{m}:{s}", } // Other sockets ]
Use {<var name>}
inside the string. <var name>
can be a-zA-Z0-9
This is a sample use case outlining all the features of trigout. The given example is for a status bar for dwm (my fork).
Configuration
[
{
"sock_name": "dwm",
"format_str": "{date} | {volume}",
}
]
2 scripts are used, one to get the date and time formatted and one for volume
Script
echo "volume=70%" | trigin dwm
-> Implementation of input
trigout dwm /tmp/dwm-status
-> Creates a file which will be updated whenever stdout is updated
ls /tmp/dwm-status | entr update-dwm-status
-> Use entr
to monitor the file for changes and run the update-dwm-status
script.
trigout is licensed under the GPL-3 license.