You are not logged in.
Pages: 1
Hello, I just have a short question. I'm currently using i3wm as my main window manager and at this moment there has been no problem but I haven't found how to manage (visual or by console) the audio outputs because I have a usb headset and I want to switch the output to it. However if I launch pulseaudio with the dmenu it doesnt work and I'm not able to find how to do it in console.
Thanks for reading
Last edited by Guisanti (2018-03-14 18:00:16)
Offline
Offline
for choosing outputs (HDMI, etc), pavucontrol is pretty handy.
for keyboard shortcuts, I wrote a helper script that lets me control the volume
#!/bin/bash
sinkName=$(pacmd info | grep 'Default sink' | awk '{print $4}')
sinkNumber=$(pacmd info | grep "sink:.*$sinkName" | awk '{print $2}')
getVolume() {
volumeInput=$(pactl list sinks)
currentVolume=$(echo "${volumeInput#*Sink #$sinkNumber}" | grep -E 'V.*-left' | grep -oE '[0-9]+%' | tail -n 1)
notify-send "Volume: $currentVolume"
echo Volume: "$currentVolume"
}
case "$1" in
up) pactl set-sink-volume @DEFAULT_SINK@ +5%; getVolume;;
down) pactl set-sink-volume @DEFAULT_SINK@ -5%; getVolume;;
mute) muted=$(pactl list sinks | grep 'Mute: yes')
if [ -z "$muted" ]; then
pactl set-sink-mute @DEFAULT_SINK@ 1
notify-send Volume: Muted
echo Volume: Muted
else
pactl set-sink-mute @DEFAULT_SINK@ 0
getVolume
fi;;
list) getVolume;;
esac
if [[ "$1" =~ [0-9]+ ]]; then
pactl set-sink-volume @DEFAULT_SINK@ "$1%"; getVolume
fi
you can display your current volume on your bar
Last edited by HiImTye (2016-12-06 05:21:54)
Offline
Grep and awk is redundant:
pacmd info | awk '/Default sink/ {print $4}'
Similarly, the grep pipeline can be replaced by a single awk process:
pactl list sinks | awk '/Volume/ {print $5; exit}'
Offline
admittedly, I haven't used awk much, except for spitting out a column out of several, but that's likely obvious by the above
Offline
For quick access to mixer from the i3 system tray have a look at pasystray
Ancestoral Clan https://cirrus.freevar.com/mclean.html
Offline
For quick access to mixer from the i3 system tray have a look at pasystray
that's awesome, I didn't realize there was another option vs. the abandoned padevchooser which I used in Ubuntu when I ran OSS/Pulseaudio
Offline
Oh thank you, what a noob question, didn't knew what front end was what I was looking for. Im not english. Thanks a lot
Offline
Pages: 1