.Nd suckless status monitor
.Sh SYNOPSIS
.Nm
-.Op Fl s
+.Op Fl so
.Sh DESCRIPTION
.Nm
is a suckless status monitor for window managers that use WM_NAME (e.g. dwm) or
.Bl -tag -width Ds
.It Fl s
Write to stdout instead of WM_NAME.
+.It Fl o
+Write only once and exit.
.El
.Sh CUSTOMIZATION
.Nm
static void
usage(void)
{
- die("usage: %s [-s]", argv0);
+ die("usage: %s [-so]", argv0);
}
int
struct sigaction act;
struct timespec start, current, diff, intspec, wait;
size_t i, len;
- int sflag, ret;
+ int sflag, oflag, ret;
char status[MAXLEN];
const char *res;
- sflag = 0;
+ sflag = oflag = 0;
ARGBEGIN {
case 's':
sflag = 1;
break;
+ case 'o':
+ oflag = 1;
+ break;
default:
usage();
} ARGEND
XFlush(dpy);
}
+ if (oflag) {
+ done = 1;
+ }
+
if (!done) {
if (clock_gettime(CLOCK_MONOTONIC, ¤t) < 0) {
die("clock_gettime:");