From a21306a3078ea054a8c552947412f954bec43ebf Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Mon, 7 Dec 2020 18:59:53 +0100 Subject: bin/soundswitch: unify selector --- bin/soundswitch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'bin') 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 -- cgit 1.4.1