summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xbin/soundswitch12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/soundswitch b/bin/soundswitch
index e2aac39..8cd8919 100755
--- a/bin/soundswitch
+++ b/bin/soundswitch
@@ -119,7 +119,7 @@ fi
 # returns the sink_id
 selects()
 {
-	pactl list short "${keyword}s" | awk '{print $2}' | menu
+	pactl list short "${1}s" | cut -f2 | menu
 }
 notif()
 {
@@ -132,7 +132,7 @@ notif()
 
 case ${mode} in
 global)
-	target=$(selects)
+	target=$(selects "${keyword}")
 	if [ -z "${target}" ]; then
 		notif "focused" "no target ${what}" err
 		exit 1
@@ -163,7 +163,7 @@ focused)
 	fi
 
 	# select where to switch to
-	target=$(selects)
+	target=$(selects "${keyword}")
 	if [ -z "${target}" ]; then
 		exit 1
 	fi
@@ -173,7 +173,7 @@ focused)
 	;;
 
 profile)
-	target_card=$(pactl list short cards | awk '{print $2}' | menu)
+	target_card=$(selects "card")
 	if [ -z "${target_card}" ]; then
 		exit 1
 	fi
@@ -195,7 +195,7 @@ profile)
 	;;
 
 hdmi)
-	target_card=$(pactl list short cards | awk '{print $2}' | menu)
+	target_card=$(selects "card")
 	if [ -z "${target_card}" ]; then
 		exit 1
 	fi
@@ -206,7 +206,7 @@ hdmi)
 	;;
 
 reset)
-	target_card=$(pactl list short cards | awk '{print $2}' | menu)
+	target_card=$(selects "card")
 	if [ -z "${target_card}" ]; then
 		exit 1
 	fi