Merge branch 'work'

This commit is contained in:
2017-09-01 11:27:23 +02:00
16 changed files with 162 additions and 136 deletions

View File

@@ -1,11 +1,13 @@
#!/bin/bash
# name of the sink. execute pactl list sinks to get a list
SINKNAME="alsa_output.pci-0000_00_1b.0.analog-stereo"
SINKNAME="$(pactl info | grep '^Default Sink:' | cut -d ' ' -f 3-)"
SINKNAME="alsa_output.usb-Logitech_Logitech_Wireless_Headset_88C626354D45-00.analog-stereo"
# this is the worst
SINK=$(( $(pactl list sinks | grep "Name: " | grep -n "${SINKNAME}"$ | grep -o "^[[:digit:]]*") -1))
getvol() {
echo $(pactl list sinks | grep "^[[:space:]]*Volume" | head -n $(( $SINK + 1 )) | tail -n 1 | grep -o "[[:digit:]]*%" | head -n 1 | cut -d "%" -f 1)
}
@@ -49,15 +51,15 @@ ismuted() {
}
mute() {
pactl set-sink-mute $SINK 1
pactl set-sink-mute $SINKNAME 1
}
unmute() {
pactl set-sink-mute $SINK 0
pactl set-sink-mute $SINKNAME 0
}
mute-toggle() {
pactl set-sink-mute $SINK toggle
pactl set-sink-mute $SINKNAME toggle
}
status() {
@@ -76,6 +78,10 @@ usage() {
}
case "$1" in
"sink")
echo $SINKNAME
echo $SINK
;;
"get-vol")
echo $(getvol)
;;