From 5fad16dbbda1ec7136272bfb7758874bd684829a Mon Sep 17 00:00:00 2001 From: Lucas Date: Sun, 31 May 2020 17:45:33 +0000 Subject: [PATCH] spoon: make mixer volume fixed width While there, remove xkblayout and rename patch, as it's OS-independent. --- ...tion.patch-OpenBSD => customization.patch} | 47 +++++++++++++++++-- 1 file changed, 43 insertions(+), 4 deletions(-) rename spoon/{customization.patch-OpenBSD => customization.patch} (58%) diff --git a/spoon/customization.patch-OpenBSD b/spoon/customization.patch similarity index 58% rename from spoon/customization.patch-OpenBSD rename to spoon/customization.patch index fdb2ab4..c528954 100644 --- a/spoon/customization.patch-OpenBSD +++ b/spoon/customization.patch @@ -1,10 +1,15 @@ diff --git a/Makefile b/Makefile -index c8452bc..7328b1f 100644 +index fe8e983..c93ae5b 100644 --- a/Makefile +++ b/Makefile -@@ -31,8 +31,8 @@ LDLIBS += $(LDLIBS_$(UNAME)_mix) - OBJ += xkblayout.o - LDLIBS += -lxkbfile +@@ -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 @@ -50,6 +55,40 @@ index 3d72888..1340db2 100644 } #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