spoon: make mixer volume fixed width

While there, remove xkblayout and rename patch, as it's OS-independent.
This commit is contained in:
Lucas 2020-05-31 17:45:33 +00:00
parent 83255497ac
commit 5fad16dbbd

View File

@ -1,10 +1,15 @@
diff --git a/Makefile b/Makefile diff --git a/Makefile b/Makefile
index c8452bc..7328b1f 100644 index fe8e983..c93ae5b 100644
--- a/Makefile --- a/Makefile
+++ b/Makefile +++ b/Makefile
@@ -31,8 +31,8 @@ LDLIBS += $(LDLIBS_$(UNAME)_mix) @@ -29,11 +29,11 @@ CPPFLAGS += -DUSE_TINYALSA=0
OBJ += xkblayout.o #CPPFLAGS += -DUSE_TINYALSA=1
LDLIBS += -lxkbfile LDLIBS += $(LDLIBS_$(UNAME)_mix)
-OBJ += xkblayout.o
-LDLIBS += -lxkbfile
+#OBJ += xkblayout.o
+#LDLIBS += -lxkbfile
-OBJ += mpd.o -OBJ += mpd.o
-LDLIBS += -lmpdclient -LDLIBS += -lmpdclient
@ -50,6 +55,40 @@ index 3d72888..1340db2 100644
} }
#ifdef __OpenBSD__ #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 diff --git a/netspeed.c b/netspeed.c
index 557e369..c154558 100644 index 557e369..c154558 100644
--- a/netspeed.c --- a/netspeed.c