25 lines
513 B
Bash
Executable file
25 lines
513 B
Bash
Executable file
#!/bin/bash
|
|
|
|
SINK="$(pactl get-default-sink)"
|
|
|
|
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
|