aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeodarZ <neodarz@neodarz.net>2017-08-21 16:21:53 +0200
committerNeodarZ <neodarz@neodarz.net>2017-08-21 16:21:53 +0200
commit4de766c6c7476586924e041bb0ad81a2e6b4abd1 (patch)
treea2ebf0315ce54a26fc7ad79d6bee15be2b8034e8
parentfb755e670c9ffac8ee6f7736b499c88c83721b44 (diff)
downloaddotfiles_ascii-4de766c6c7476586924e041bb0ad81a2e6b4abd1.tar.xz
dotfiles_ascii-4de766c6c7476586924e041bb0ad81a2e6b4abd1.zip
Add option to configure the sinkport
-rw-r--r--i3/.config/i3/config2
-rwxr-xr-xi3/.config/i3/switch_audio.sh8
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