https://github.com/atmatto/sw
Minimal stopwatch written in Go
https://github.com/atmatto/sw
Last synced: 3 months ago
JSON representation
Minimal stopwatch written in Go
- Host: GitHub
- URL: https://github.com/atmatto/sw
- Owner: atmatto
- License: gpl-3.0
- Created: 2021-07-04T11:56:40.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-04T12:18:11.000Z (almost 4 years ago)
- Last Synced: 2024-06-21T04:48:50.869Z (12 months ago)
- Language: Go
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
sw
Minimal stopwatch written in Go.
usage:
sw reset Reset stopwatch. `sw resume` will start counting from 0.
sw pause Pause counting.
sw resume Resume after pausing or start after resetting.
sw show Just show the counter.Current state is saved in `~/.sw`
===
Example use - integration with dwm and slstatus
dwm config.h
static const char *swreset[] = { "sw", "reset", NULL };
static const char *swresume[] = { "sw", "resume", NULL };
static const char *swpause[] = { "sw", "pause", NULL };
[...]
static Button buttons[] = {
/* click event mask button function argument */
{ ClkStatusText, 0, Button2, spawn, {.v = swreset } },
{ ClkStatusText, 0, Button1, spawn, {.v = swresume } },
{ ClkStatusText, 0, Button3, spawn, {.v = swpause } },
[...]
};slstatus config.h
static const struct arg args[] = {
/* function format argument */
{ run_command, "%s ", "sw show" },
[...]
};