feat: audio selector util finished
This commit is contained in:
@@ -148,3 +148,5 @@ Print
|
|||||||
flameshot gui
|
flameshot gui
|
||||||
super + m
|
super + m
|
||||||
st -e ncmpcpp
|
st -e ncmpcpp
|
||||||
|
super + n
|
||||||
|
bash ~/.config/utils/selectors/audio_output.sh
|
||||||
|
|||||||
@@ -24,15 +24,24 @@ getFormalNameFromSink() {
|
|||||||
*HDMI*)
|
*HDMI*)
|
||||||
echo "External screen audio"
|
echo "External screen audio"
|
||||||
;;
|
;;
|
||||||
|
*pci*)
|
||||||
|
echo "Core jack"
|
||||||
|
;;
|
||||||
|
*Logitech*)
|
||||||
|
echo "Logitech headset"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo $1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
declare -A sink_map
|
declare -A sink_map
|
||||||
declare menu_options
|
declare menu_options
|
||||||
|
|
||||||
sink_list=$(pactl list sinks | grep -e "Name" | awk -F: '{print $2}' | xargs)
|
readarray -t sink_list < <(pactl list sinks | grep -e "Name" | awk -F: '{print $2}')
|
||||||
|
|
||||||
for sink in $sink_list; do
|
for sink in "${sink_list[@]}"; do
|
||||||
formal_name=$(getFormalNameFromSink $sink)
|
formal_name=$(getFormalNameFromSink $sink)
|
||||||
sink_map["$formal_name"]="$sink"
|
sink_map["$formal_name"]="$sink"
|
||||||
if [[ ${#menu_options} -ne 0 ]]; then
|
if [[ ${#menu_options} -ne 0 ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user