env/spoon/customization.patch

105 lines
2.5 KiB
Diff
Raw Normal View History

diff --git a/Makefile b/Makefile
index fe8e983..c93ae5b 100644
--- a/Makefile
+++ b/Makefile
@@ -29,11 +29,11 @@ CPPFLAGS += -DUSE_TINYALSA=0
#CPPFLAGS += -DUSE_TINYALSA=1
LDLIBS += $(LDLIBS_$(UNAME)_mix)
-OBJ += xkblayout.o
-LDLIBS += -lxkbfile
+#OBJ += xkblayout.o
+#LDLIBS += -lxkbfile
-OBJ += mpd.o
-LDLIBS += -lmpdclient
+#OBJ += mpd.o
+#LDLIBS += -lmpdclient
all: $(BIN)
diff --git a/batt.c b/batt.c
index 3d72888..1340db2 100644
--- a/batt.c
+++ b/batt.c
@@ -4,30 +4,14 @@
#include "types.h"
#include "util.h"
-char *crit[] = {
- "[!!!!]=",
- " ",
-};
-
void
battprint(char *buf, size_t len, int acon, int life)
{
char c;
static int frame = 0;
- c = acon ? '>' : '<';
- if (!acon && life <= 5)
- snprintf(buf, len, "%s", crit[frame++ % LEN(crit)]);
- else if (life >= 80)
- snprintf(buf, len, "[////]=");
- else if (life >= 60)
- snprintf(buf, len, "[///%c]=", c);
- else if (life >= 40)
- snprintf(buf, len, "[//%c%c]=", c, c);
- else if (life >= 20)
- snprintf(buf, len, "[/%c%c%c]=", c, c, c);
- else
- snprintf(buf, len, "[%c%c%c%c]=", c, c, c, c);
+ c = acon ? '^' : 'v';
+ snprintf(buf, len, "B%c%3d%%", (frame ^= 1) ? c : ' ', life);
}
#ifdef __OpenBSD__
diff --git a/mix.c b/mix.c
index e765734..1fefc66 100644
--- a/mix.c
+++ b/mix.c
@@ -148,7 +148,7 @@ mixread(void *arg, char *buf, size_t len)
}
init_done = poll_peek();
- snprintf(buf, len, "%d%%", get_output());
+ snprintf(buf, len, "%3d%%", get_output());
return 0;
}
@@ -253,9 +253,9 @@ readvol:
goto out;
}
if (active)
- snprintf(buf, len, "%d%%", master);
+ snprintf(buf, len, "%3d%%", master);
else
- snprintf(buf, len, "!%d%%", master);
+ snprintf(buf, len, "!%3d%%", master);
return 0;
out:
snd_mixer_free(mixerp);
@@ -296,7 +296,7 @@ mixread(void *arg, char *buf, size_t len)
cur = mixer_ctl_get_value(ctl, 0);
max = mixer_ctl_get_range_max(ctl);
- snprintf(buf, len, "%d%%", cur * 100 / max);
+ snprintf(buf, len, "%3d%%", cur * 100 / max);
return 0;
out:
diff --git a/netspeed.c b/netspeed.c
index 557e369..c154558 100644
--- a/netspeed.c
+++ b/netspeed.c
@@ -32,7 +32,7 @@ updatenetspeed(char *buf, size_t len, uint64_t rxbytes, uint64_t txbytes)
tx = (txbytes - oldtxbytes) / delay;
irx = humansz(rx);
itx = humansz(tx);
- snprintf(buf, len, "D:%6.1f%s/s U:%6.1f%s/s", rx
+ snprintf(buf, len, "v%6.1f%s/s ^%6.1f%s/s", rx
/ (double)(1 << (10 * irx)), humansztbl[irx], tx
/ (double)(1 << (10 * itx)), humansztbl[itx]);
oldrxbytes = rxbytes;