commit 76c9afc7fb8eec3f1a5ccc2011247c4cb2704476
parent fcb10f066161aed8dbc74f8c80733ff7b5ffb47b
Author: sin <sin@2f30.org>
Date: Sat, 1 Nov 2014 15:04:44 +0000
Add flag to select bar placement
Diffstat:
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/xbattmon.c b/xbattmon.c
@@ -212,8 +212,9 @@ again:
void
usage(void)
{
- fprintf(stderr, "usage: %s [-i interval] [-t thickness]\n", argv0);
+ fprintf(stderr, "usage: %s [-i interval] [-p bottom | top] [-t thickness]\n", argv0);
fprintf(stderr, " -i\tbattery poll interval in seconds\n");
+ fprintf(stderr, " -p\tbar placement\n");
fprintf(stderr, " -t\tbar thickness\n");
exit(1);
}
@@ -231,6 +232,15 @@ main(int argc, char *argv[])
if (errstr)
errx(1, "%s: %s", arg, errstr);
break;
+ case 'p':
+ arg = EARGF(usage());
+ if (strcmp(arg, "bottom") == 0)
+ bottom = 1;
+ else if (strcmp(arg, "top") == 0)
+ bottom = 0;
+ else
+ errx(1, "%s: invalid placement", arg);
+ break;
case 't':
arg = EARGF(usage());
thickness = strtonum(arg, 0, INT_MAX, &errstr);