mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-01 14:52:14 +01:00
Pulseaudio support is not included since the testing/pulseaudio package is somewhat broken currently.
81 lines
2.8 KiB
Diff
81 lines
2.8 KiB
Diff
diff -upr i3status-2.10.orig/Makefile i3status-2.10/Makefile
|
|
--- i3status-2.10.orig/Makefile 2016-01-07 19:53:31.912304558 +0100
|
|
+++ i3status-2.10/Makefile 2016-01-07 19:55:02.869685848 +0100
|
|
@@ -24,6 +24,10 @@ LIBS+=-lyajl
|
|
LIBS+=-lpulse
|
|
LIBS+=-lm
|
|
|
|
+ifeq ($(OS),OpenBSD)
|
|
+LIBS+=-lpthread
|
|
+endif
|
|
+
|
|
VERSION=2.10
|
|
GIT_VERSION="2.10 (2016-01-01)"
|
|
OS:=$(shell uname)
|
|
@@ -70,10 +74,8 @@ CFLAGS += -idirafter yajl-fallback
|
|
OBJS:=$(wildcard src/*.c *.c)
|
|
OBJS:=$(OBJS:.c=.o)
|
|
|
|
-ifeq ($(OS),OpenBSD)
|
|
OBJS:=$(filter-out src/pulse.o, $(OBJS))
|
|
-LIBS:=$(filter-out -lpulse, $(LIBS)) -lpthread
|
|
-endif
|
|
+LIBS:=$(filter-out -lpulse, $(LIBS))
|
|
|
|
src/%.o: src/%.c include/i3status.h
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
|
diff -upr i3status-2.10.orig/src/print_volume.c i3status-2.10/src/print_volume.c
|
|
--- i3status-2.10.orig/src/print_volume.c 2016-01-07 19:53:31.912304558 +0100
|
|
+++ i3status-2.10/src/print_volume.c 2016-01-07 19:53:44.447718125 +0100
|
|
@@ -60,50 +60,6 @@ void print_volume(yajl_gen json_gen, cha
|
|
free(instance);
|
|
}
|
|
|
|
-#ifndef __OpenBSD__
|
|
- /* Try PulseAudio first */
|
|
-
|
|
- /* If the device name has the format "pulse[:N]" where N is the
|
|
- * index of the PulseAudio sink then force PulseAudio, optionally
|
|
- * overriding the default sink */
|
|
- if (!strncasecmp(device, "pulse", strlen("pulse"))) {
|
|
- uint32_t sink_idx = device[5] == ':' ? (uint32_t)atoi(device + 6)
|
|
- : DEFAULT_SINK_INDEX;
|
|
- int cvolume = pulse_initialize() ? volume_pulseaudio(sink_idx) : 0;
|
|
- int ivolume = DECOMPOSE_VOLUME(cvolume);
|
|
- bool muted = DECOMPOSE_MUTED(cvolume);
|
|
- if (muted) {
|
|
- START_COLOR("color_degraded");
|
|
- pbval = 0;
|
|
- }
|
|
- /* negative result means error, stick to 0 */
|
|
- if (ivolume < 0)
|
|
- ivolume = 0;
|
|
- outwalk = apply_volume_format(muted ? fmt_muted : fmt,
|
|
- outwalk,
|
|
- ivolume);
|
|
- goto out;
|
|
- } else if (!strcasecmp(device, "default") && pulse_initialize()) {
|
|
- /* no device specified or "default" set */
|
|
- int cvolume = volume_pulseaudio(DEFAULT_SINK_INDEX);
|
|
- int ivolume = DECOMPOSE_VOLUME(cvolume);
|
|
- bool muted = DECOMPOSE_MUTED(cvolume);
|
|
- if (ivolume >= 0) {
|
|
- if (muted) {
|
|
- START_COLOR("color_degraded");
|
|
- pbval = 0;
|
|
- }
|
|
- outwalk = apply_volume_format(muted ? fmt_muted : fmt,
|
|
- outwalk,
|
|
- ivolume);
|
|
- goto out;
|
|
- }
|
|
- /* negative result means error, fail PulseAudio attempt */
|
|
- }
|
|
-/* If some other device was specified or PulseAudio is not detected,
|
|
- * proceed to ALSA / OSS */
|
|
-#endif
|
|
-
|
|
#ifdef LINUX
|
|
int err;
|
|
snd_mixer_t *m;
|