dotfiles/.i3blocks/toggle-sink
2020-12-31 11:14:20 +01:00

24 lines
559 B
Bash
Executable file

#!/bin/bash
currentport=$(pacmd list-sinks | grep -Po "active port: <analog.*")
if [[ -n "$button" ]]
then
if [[ "$currentport" == "active port: <analog-output-lineout>" ]]
then
pacmd set-sink-port "alsa_output.pci-0000_0b_00.3.analog-stereo" "analog-output-headphones"
echo "casque"
else
pacmd set-sink-port "alsa_output.pci-0000_0b_00.3.analog-stereo" "analog-output-lineout"
echo "front "
fi
pkill -RTMIN+10 i3blocks
else
if [[ "$currentport" == "active port: <analog-output-lineout>" ]]
then
echo "front "
else
echo "casque"
fi
fi