diff options
-rw-r--r-- | i3/.config/i3/config | 2 | ||||
-rwxr-xr-x | i3/.config/i3/switch_audio.sh | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/i3/.config/i3/config b/i3/.config/i3/config index 9715d04..4d3d403 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -114,7 +114,7 @@ bindsym $WinKey+Shift+F8 exec terminator -e qutebrowser bindsym $WinKey+control+l exec i3lock-fancy bindsym $WinKey+p exec passmenu #bindsym $WinKey+Shift+$AltKey+0 exec ~/.config/i3/switch-workspace.py 6 -bindsym XF86AudioPlay exec ~/.config/i3/switch_audio.sh +bindsym XF86AudioPlay exec ~/.config/i3/switch_audio.sh 8 # start a terminal bindsym $WinKey+Return exec qterminal diff --git a/i3/.config/i3/switch_audio.sh b/i3/.config/i3/switch_audio.sh index ee8531a..aff2543 100755 --- a/i3/.config/i3/switch_audio.sh +++ b/i3/.config/i3/switch_audio.sh @@ -1,12 +1,16 @@ #/bin/sh +# Usage : +# switch_audio.sh <sinkport_number> + headphones="analog-output-headphones" lineout="analog-output-lineout" +sinkport="$1" if [[ $(echo $(pacmd list | grep "active port") | cut -d" " -f3 | cut -d"<" -f2 | cut -d">" -f1) == $lineout ]] then - pacmd set-sink-port 0 $headphones + pacmd set-sink-port $sinkport $headphones elif [[ $(echo $(pacmd list | grep "active port") | cut -d" " -f3 | cut -d"<" -f2 | cut -d">" -f1) == $headphones ]] then - pacmd set-sink-port 0 $lineout + pacmd set-sink-port $sinkport $lineout fi |