diff options
| author | Robert Günzler <r@gnzler.io> | 2020-12-07 18:59:53 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2020-12-07 19:28:05 +0100 |
| commit | a21306a3078ea054a8c552947412f954bec43ebf (patch) | |
| tree | 3c89032383522aa3883f66e0a70eb1ca61197ac0 /bin | |
| parent | abdc0af171d6b7d5ab9adb28d9ffe20852df99bd (diff) | |
bin/soundswitch: unify selector
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/soundswitch | 12 |
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 |