An open API service indexing awesome lists of open source software.

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

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" },
[...]
};