simplified vol_perc() (and with that config.def.h is super clean)
authorAaron Marcher <info@nulltime.net>
Tue, 13 Sep 2016 19:08:44 +0000 (21:08 +0200)
committerAaron Marcher (drkhsh) <info@nulltime.net>
Tue, 13 Sep 2016 19:08:44 +0000 (21:08 +0200)
config.def.h
slstatus.c

index 8cf8e56a88905fb6777ec902b8b37b2fab3323c5..a445aa7524646ac08c3da934b60f9dda9f86aed5 100644 (file)
@@ -1,8 +1,5 @@
 /* See LICENSE file for copyright and license details. */
 
-/* alsa sound */
-#define ALSA_CHANNEL    "Master"
-
 /* how often to update the statusbar (min value == 1) */
 #define UPDATE_INTERVAL 1
 
index f61e98799e61c376e502448b674bd0456f78bbb2..1b45f647f5a14e967f2d5c1c075e4869c432e7eb 100644 (file)
@@ -459,7 +459,7 @@ uid(void)
 
 
 static char *
-vol_perc(const char *snd_card)
+vol_perc(const char *soundcard)
 { /* FIX THIS SHIT! */
        long int vol, max, min;
        snd_mixer_t *handle;
@@ -471,7 +471,7 @@ vol_perc(const char *snd_card)
        snd_mixer_selem_register(handle, NULL, NULL);
        snd_mixer_load(handle);
        snd_mixer_selem_id_malloc(&s_elem);
-       snd_mixer_selem_id_set_name(s_elem, ALSA_CHANNEL);
+       snd_mixer_selem_id_set_name(s_elem, "Master");
        elem = snd_mixer_find_selem(handle, s_elem);
 
        if (elem == NULL) {