26 lines
583 B
Bash
Executable file
26 lines
583 B
Bash
Executable file
#!/bin/bash
|
|
|
|
#SINK="alsa_output.pci-0000_2b_00.3.3.analog-stereo"
|
|
SINK="alsa_output.pci-0000_2b_00.3.analog-stereo"
|
|
|
|
currentport=$(pactl list sinks | grep -Po "Active Port: analog.*")
|
|
|
|
if [[ -n "$button" ]]
|
|
then
|
|
if [[ "$currentport" == "Active Port: analog-output-lineout" ]]
|
|
then
|
|
pactl set-sink-port "$SINK" "analog-output-headphones"
|
|
echo "casque"
|
|
else
|
|
pactl set-sink-port "$SINK" "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
|