diff --git a/home/bin/audio-chooser b/home/bin/audio-chooser old mode 100644 new mode 100755 index 50d4b9bec..6e07f7af8 --- a/home/bin/audio-chooser +++ b/home/bin/audio-chooser @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -choices=("Headphones" "Speakers" "Headphones (Output-Only)") +choices=("headphones" "speakers" "headphones (output-only)") selected=$(for c in "${choices[@]}"; do echo "$c"; done | rofi -dmenu -p "Select Audio Setup: ") echo You Picked: " $selected" @@ -10,29 +10,33 @@ headset=alsa_card.usb-0b0e_Jabra_Link_380_08C8C2E6DA47-00 speakers=alsa_card.pci-0000_00_1f.3 case $selected in -Headphones) +headphones) echo "Setting up Headphones" pactl set-card-profile "$headset" output:analog-stereo+input:mono-fallback pactl set-card-profile "$speakers" off ;; -Speakers) +speakers) echo "Setting up Speakers" pactl set-card-profile "$speakers" output:analog-stereo+input:analog-stereo pactl set-card-profile "$headset" off ;; -"Headphones (Output-Only)") +"headphones (output-only)") echo "Setting up Headphones (Output-Only)" pactl set-card-profile "$headset" output:analog-stereo pactl set-card-profile "$speakers" off ;; +*) + echo "Invalid Option $selected" + exit 1 + ;; esac pactl list short sinks | while read -r sink; do sink_idx=$(echo "$sink" | cut -f1) - pamixer --unmute --sink "$sink_idx" + pamixer --unmute --sink "$sink_idx" || true done pactl list short sources | while read -r source; do source_idx=$(echo "$source" | cut -f1) - pamixer --unmute --source "$source_idx" + pamixer --unmute --source "$source_idx" || true done