[wiki] [sites] fixed a bug with the dwmstatus volume display || Andrew Milkovich

From: <git_AT_suckless.org>
Date: Wed, 23 Jan 2013 22:31:08 +0100

commit 30fa01f95d6ac205115d968296ec6ce7cf7f495f
Author: Andrew Milkovich <amilkovich_AT_gmail.com>
Date: Wed Jan 23 13:30:57 2013 -0800

    fixed a bug with the dwmstatus volume display

diff --git a/dwm.suckless.org/dwmstatus/p1c0-dwmstatus-volume.c b/dwm.suckless.org/dwmstatus/p1c0-dwmstatus-volume.c
index 308b51c..a9ac939 100644
--- a/dwm.suckless.org/dwmstatus/p1c0-dwmstatus-volume.c
+++ b/dwm.suckless.org/dwmstatus/p1c0-dwmstatus-volume.c
_AT_@ -1,7 +1,7 @@
 /* made by p1c0 2013-1-23.
 **
 ** Compile with:
-** gcc -Wall -pedantic -std=c99 -lX11 status.c
+** gcc -Wall -pedantic -std=c99 status.c -lX11
 **
 ** Notes:
 ** bind volume keys in dwm config.h
_AT_@ -176,7 +176,8 @@ main(int argc, char *argv[])
                 if (strcmp(argv[1], "volume") == 0) {
                         if (strcmp(argv[2], "up") == 0) {
                                 volume = getvolume();
- if (volume < 100) volume += 5;
+ if (volume < 100)
+ volume += 5;
                                 setvolume(volume);
                                 volumebar = mkprogressbar(22, volume);
                                 avgs = loadavg();
_AT_@ -191,7 +192,8 @@ main(int argc, char *argv[])
                                 exit(0);
                         } else if (strcmp(argv[2], "down") == 0) {
                                 volume = getvolume();
- if (volume > 0) volume -= 5;
+ if (volume > 0)
+ volume -= 5;
                                 setvolume(volume);
                                 volumebar = mkprogressbar(22, volume);
                                 avgs = loadavg();
_AT_@ -208,10 +210,10 @@ main(int argc, char *argv[])
                 }
         }
 
- volume = getvolume();
         for (;;sleep(90)) {
                 avgs = loadavg();
                 tla = mktimes("%H:%M", tzla);
+ volume = getvolume();
                 volumebar = mkprogressbar(22, volume);
                 status = smprintf("%i%% %s | %s | %s",
                         volume, volumebar, avgs, tla);
Received on Wed Jan 23 2013 - 22:31:08 CET

This archive was generated by hypermail 2.3.0 : Wed Jan 23 2013 - 22:36:07 CET