1

I am writing my own status bar program for suckless dwm and the last thing left on the list is getting volume percentage from default pulseaudio sink. In bash, I have solved this with this pipe:

pactl list sinks | awk '$1=="Volume:" {print $5}'

Is there a good way to do it in C?

skink
  • 5,133
  • 6
  • 37
  • 58
Anej
  • 31
  • 3
  • 1
    This code exactly works on my system. (debian+xfce) https://gist.github.com/jasonwhite/1df6ee4b5039358701d2 – EsmaeelE Nov 13 '19 at 21:58
  • consider before compile install: `libpulse-dev`library for a debian base: `sudo apt install libpulse-dev` – EsmaeelE Nov 13 '19 at 21:59
  • Change volume with default `xfce4-pulseaudio-plugin` in my desktop, the code can correctly show the correct volume. – EsmaeelE Nov 13 '19 at 22:02

0 Answers0